Skip to content

Restore New Architecture support with react-native >= 0.76 #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class RNCProgressViewComponentDescriptor final
: ConcreteComponentDescriptor(parameters),
imageManager_(std::make_shared<ImageManager>(contextContainer_)) {}

void adopt(ShadowNode::Unshared const &shadowNode) const override {
void adopt(ShadowNode& shadowNode) const override {
ConcreteComponentDescriptor::adopt(shadowNode);

auto progressViewhadowNode =
std::static_pointer_cast<RNCProgressViewShadowNode>(shadowNode);
auto& progressViewShadowNode =
static_cast<RNCProgressViewShadowNode&>(shadowNode);

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

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <react/renderer/core/LayoutContext.h>
#include <react/renderer/imagemanager/ImageManager.h>
#include <react/renderer/imagemanager/primitives.h>
#include <react/renderer/core/ShadowNodeFamily.h>

#include "RNCProgressViewState.h"

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

static RNCProgressViewState initialStateData(
ShadowNodeFragment const &fragment,
ShadowNodeFamilyFragment const &familyFragment,
ComponentDescriptor const &componentDescriptor) {
const Props::Shared& props,
const ShadowNodeFamily::Shared& family,
const ComponentDescriptor& componentDescriptor) {
auto imageSource = ImageSource{ImageSource::Type::Invalid};
return {
imageSource,
Expand Down
2 changes: 2 additions & 0 deletions fabric-example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ dist/
local.properties
msbuild.binlog
node_modules/
**/.xcode.env.local
.kotlin/
2 changes: 1 addition & 1 deletion fabric-example/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
4 changes: 1 addition & 3 deletions fabric-example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require_relative '../node_modules/react-native-test-app/test_app'

use_flipper!

workspace 'fabricexample.xcworkspace'

use_test_app! :fabric_enabled => true, :turbomodule_enabled => true, :hermes_enabled => true
use_test_app! :fabric_enabled => true, :new_arch_enabled => true, :hermes_enabled => true
Loading
Loading