Skip to content

Commit 68baff1

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Add getDiffProps for Unimplemented View component (#51166)
Summary: Pull Request resolved: #51166 See title Changelog: [Internal] Reviewed By: rshest Differential Revision: D74327337 fbshipit-source-id: c5b44d833fccaa200d6019932dd5e9b1760c3af3
1 parent 73a03d5 commit 68baff1

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,23 @@ ComponentName UnimplementedViewProps::getComponentName() const {
1717
return componentName_;
1818
}
1919

20+
#ifdef ANDROID
21+
folly::dynamic UnimplementedViewProps::getDiffProps(
22+
const Props* prevProps) const {
23+
static const auto defaultProps = UnimplementedViewProps();
24+
25+
const UnimplementedViewProps* oldProps = prevProps == nullptr
26+
? &defaultProps
27+
: static_cast<const UnimplementedViewProps*>(prevProps);
28+
29+
folly::dynamic result = ViewProps::getDiffProps(oldProps);
30+
31+
if (componentName_ != oldProps->componentName_) {
32+
result["name"] = componentName_;
33+
}
34+
35+
return result;
36+
}
37+
#endif
38+
2039
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ class UnimplementedViewProps final : public ViewProps {
2727
void setComponentName(ComponentName componentName);
2828
ComponentName getComponentName() const;
2929

30+
#ifdef ANDROID
31+
32+
folly::dynamic getDiffProps(const Props* prevProps) const override;
33+
34+
#endif
35+
3036
private:
3137
mutable ComponentName componentName_{};
3238
};

0 commit comments

Comments
 (0)