Skip to content

Commit 802451a

Browse files
Restore New Architecture support with react-native >= 0.76 (#155)
1 parent aebeb2d commit 802451a

File tree

11 files changed

+5563
-4274
lines changed

11 files changed

+5563
-4274
lines changed

common/cpp/react/renderer/components/progressview/RNCProgressViewComponentDescriptors.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class RNCProgressViewComponentDescriptor final
1818
: ConcreteComponentDescriptor(parameters),
1919
imageManager_(std::make_shared<ImageManager>(contextContainer_)) {}
2020

21-
void adopt(ShadowNode::Unshared const &shadowNode) const override {
21+
void adopt(ShadowNode& shadowNode) const override {
2222
ConcreteComponentDescriptor::adopt(shadowNode);
2323

24-
auto progressViewhadowNode =
25-
std::static_pointer_cast<RNCProgressViewShadowNode>(shadowNode);
24+
auto& progressViewShadowNode =
25+
static_cast<RNCProgressViewShadowNode&>(shadowNode);
2626

2727
// `RNCProgressViewShadowNode` uses `ImageManager` to initiate image loading
2828
// and communicate the loading state and results to mounting layer.
29-
progressViewhadowNode->setImageManager(imageManager_);
29+
progressViewShadowNode.setImageManager(imageManager_);
3030
}
3131

3232
private:

common/cpp/react/renderer/components/progressview/RNCProgressViewShadowNode.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <react/renderer/core/LayoutContext.h>
88
#include <react/renderer/imagemanager/ImageManager.h>
99
#include <react/renderer/imagemanager/primitives.h>
10+
#include <react/renderer/core/ShadowNodeFamily.h>
1011

1112
#include "RNCProgressViewState.h"
1213

@@ -29,9 +30,9 @@ class JSI_EXPORT RNCProgressViewShadowNode final
2930
void setImageManager(const SharedImageManager &imageManager);
3031

3132
static RNCProgressViewState initialStateData(
32-
ShadowNodeFragment const &fragment,
33-
ShadowNodeFamilyFragment const &familyFragment,
34-
ComponentDescriptor const &componentDescriptor) {
33+
const Props::Shared& props,
34+
const ShadowNodeFamily::Shared& family,
35+
const ComponentDescriptor& componentDescriptor) {
3536
auto imageSource = ImageSource{ImageSource::Type::Invalid};
3637
return {
3738
imageSource,

fabric-example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ dist/
1212
local.properties
1313
msbuild.binlog
1414
node_modules/
15+
**/.xcode.env.local
16+
.kotlin/

fabric-example/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
};

fabric-example/ios/Podfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative '../node_modules/react-native-test-app/test_app'
22

3-
use_flipper!
4-
53
workspace 'fabricexample.xcworkspace'
64

7-
use_test_app! :fabric_enabled => true, :turbomodule_enabled => true, :hermes_enabled => true
5+
use_test_app! :fabric_enabled => true, :new_arch_enabled => true, :hermes_enabled => true

0 commit comments

Comments
 (0)