This repository is a Turbo Module implementation of Clipboard Core React Native module.
- Create a new npm package
- Add
react-native-tscodegen
andreact-native-tscodegen-types
as devDependencies - Copy
TurboClipboard.podspec
, rename it, change library name, author etc - Implement
TurboModule.ts
file: define all the methods in the Spec interface - Copy
react-native-tscodegen.json
, rename library name etc - Add
codegen
script topackage.json
with the following command to run:react-native-tscodegen ./react-native-tscodegen.json
- Run
npm run codegen
- it will generate Spec files - the JSI bridge which you should include in your sources. Your native module interface should extendNSObject <ModuleNameSpec>
- the generated spec by the codegen of yourTurboModule.ts
- Add your implementation source files following the example of
TurboClipboard
header andmm
file - Change
source_files
in the PodSpec accordingly - Include in your TurboModule enabled application
- Use it
MIT