Skip to content

Commit 950153a

Browse files
authored
feat: add info about new architecture in readme (#421)
1 parent c8e5ab0 commit 950153a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,58 @@ You can also do this manually by:
136136
- Installing pods for iOS app
137137
- Running example app like always: `npx react-native run-<platform>`
138138

139+
### New architecture setup (Fabric)
140+
141+
In order to use the new architecture some extra steps are needed.
142+
#### iOS
143+
- Install pods with new arch flag inside `example/ios` folder: `RCT_NEW_ARCH_ENABLED=1 pod install`
144+
- Run `npm run example-ios`
145+
146+
#### Android
147+
- Set `newArchEnabled` to true inside `example/android/gradle.properties`
148+
- Run `npm run example-android`
149+
150+
<details>
151+
<summary>
152+
If you are using React Native version lower than 0.70, you need to setup manual linking for Android to work.
153+
</summary>
154+
155+
Inside `example/android/app/src/main/jni/Android.mk` add these lines:
156+
157+
```diff
158+
+ include $(NODE_MODULES_DIR)/@react-native-community/slider/android/build/generated/source/codegen/jni/Android.mk
159+
include $(CLEAR_VARS)
160+
```
161+
162+
```diff
163+
libreact_codegen_rncore \
164+
+ libreact_codegen_ReactSlider \
165+
libreact_debug \
166+
```
167+
168+
Inside `example/android/app/src/main/jni/MainComponentsRegistry.cpp` update these lines:
169+
170+
```diff
171+
#include <react/renderer/components/rncore/ComponentDescriptors.h>
172+
+ #include <react/renderer/components/ReactSlider/ComponentDescriptors.h>
173+
174+
...
175+
176+
MainComponentsRegistry::sharedProviderRegistry() {
177+
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
178+
179+
// Custom Fabric Components go here. You can register custom
180+
// components coming from your App or from 3rd party libraries here.
181+
//
182+
// providerRegistry->add(concreteComponentDescriptorProvider<
183+
// AocViewerComponentDescriptor>());
184+
+ providerRegistry->add(concreteComponentDescriptorProvider<RNCSliderComponentDescriptor>());
185+
186+
return providerRegistry;
187+
}
188+
```
189+
190+
</details>
139191

140192
## Maintainers
141193

0 commit comments

Comments
 (0)