Files
react-native-svg/common/cpp/react/renderer/components/rnsvg/RNSVGLayoutableShadowNode.h
Jakub Grzywacz d3d61a5fc1 feat: custom shadow nodes (#2568)
# Summary

Implement custom shadow nodes for nearly all `Svg` components. While
it's a foundation for numerous upcoming changes, it currently addresses
and resolves #2544.

## Test Plan

There shouldn't be any noticeable changes, and everything should
function as before, except that `onLayout` will now be triggered only
once and with the correct dimensions.

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| iOS     |          |
| MacOS   |          |
| Android |          |

---------

Co-authored-by: Jakub Piasecki <jakubpiasecki67@gmail.com>
2024-12-12 11:48:46 +01:00

20 lines
529 B
C++

#include <react/renderer/components/view/YogaLayoutableShadowNode.h>
namespace facebook::react {
class RNSVGLayoutableShadowNode : public YogaLayoutableShadowNode {
public:
RNSVGLayoutableShadowNode(
const ShadowNodeFragment &fragment,
const ShadowNodeFamily::Shared &family,
ShadowNodeTraits traits);
RNSVGLayoutableShadowNode(
const ShadowNode &sourceShadowNode,
const ShadowNodeFragment &fragment);
void layout(LayoutContext layoutContext) override;
};
} // namespace facebook::react