You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This script first adds the `RTNCenteredText` module to the app with `yarn add`. Then, it invokes Codegen via the `generate-artifacts.js` script.
@@ -520,3 +520,59 @@ Differently from Native Components, Fabric requires us to manually implement the
520
520
#### Android
521
521
522
522
### Adding the Fabric Component To Your App
523
+
524
+
This is the last step to finally see our Fabric Component running on our app.
525
+
526
+
#### iOS
527
+
528
+
To achieve this in iOS, we need to issue a couple of commands and then we can read the Component from JS.
529
+
530
+
First of all, we need to add the NPM package which contains the Component to the app. This can be done with the following command:
531
+
532
+
```sh
533
+
cd MyApp
534
+
yarn add ../RTNCenteredText
535
+
```
536
+
537
+
This command will add the `RTNCenteredText` Component to the `node_modules` of your app. Then, we need to install the new dependencies in our iOS project. To do so, we need to run these commands:
538
+
539
+
```sh
540
+
cd ios
541
+
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
542
+
```
543
+
544
+
This command will look for all the dependencies of the project and it will install the iOS ones. The `RCT_NEW_ARCH_ENABLED=1` instruct **Cocoapods** that it has to run some additional operations to run the **CodeGen** that is required by **Fabric**.
545
+
546
+
:::note
547
+
You may have to run `bundle install` once before you can use `RCT_NEW_ARCH_ENABLED=1 bundle exec pod install`. You won't need to run `bundle install` anymore, unless you need to change the ruby dependencies.
548
+
:::
549
+
550
+
#### Android
551
+
552
+
#### JS
553
+
Finally, we can read the Component in our JS application.
554
+
To do so, we have to:
555
+
556
+
1. Import the Component in the js file that uses it. So, if we want to use it in the `App.js`, we need to add this line:
0 commit comments