diff --git a/docs/the-new-architecture/pillars-turbomodule.md b/docs/the-new-architecture/pillars-turbomodule.md index c9a1d4d4f7b..582774fd4c4 100644 --- a/docs/the-new-architecture/pillars-turbomodule.md +++ b/docs/the-new-architecture/pillars-turbomodule.md @@ -656,3 +656,46 @@ Then, to manually link your new TurboModule: return rncore_ModuleProvider(moduleName, params); } ``` + +### JavaScript + +Now you can use your TurboModule calculator in your app! + +Here's an example App.js file using the `add` method: + +```js title="App.js" +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + * @flow strict-local + */ +import React from 'react'; +import {useState} from 'react'; +import type {Node} from 'react'; +import {SafeAreaView, StatusBar, Text, Button} from 'react-native'; +import RTNCalculator from 'rtn-calculator/js/NativeCalculator.js'; + +const App: () => Node = () => { + const [currentResult, setResult] = useState(null); + return ( + + + + 3+7={currentResult ?? '??'} + +