File tree Expand file tree Collapse file tree 2 files changed +5
-25
lines changed
packages/create-react-native-library/templates Expand file tree Collapse file tree 2 files changed +5
-25
lines changed Original file line number Diff line number Diff line change 2424 " ios" ,
2525 " cpp" ,
2626<% if (project.nitro) { -%>
27- " nitro " ,
27+ " nitrogen " ,
2828<% } -%>
2929 " *.podspec" ,
3030 " react-native.config.js" ,
5151<% } else { -%>
5252 "clean" : " del-cli lib" ,
5353<% } -%>
54- <% if (example !== 'expo') { -%>
55- "nitrogen" : " nitro-codegen" ,
56- "prepare" : " bob build && yarn nitrogen" ,
57- <% } else { -%>
5854 "prepare" : " bob build" ,
55+ <% if (project.nitro) { -%>
56+ "nitrogen" : " nitro-codegen" ,
5957<% } -%>
6058 "release" : " release-it"
6159 },
Original file line number Diff line number Diff line change 11import { NitroModules } from 'react-native-nitro-modules' ;
2- import { Platform } from 'react-native' ;
32import type { < % - project . name - % > } from './<%- project.name -%>.nitro' ;
43
5- const LINKING_ERROR =
6- `The package '<%- project.slug -%>' doesn't seem to be linked. Make sure: \n\n` +
7- Platform . select ( { ios : "- You have run 'pod install'\n" , default : '' } ) +
8- '- You rebuilt the app after installing the package\n' +
9- '- You are not using Expo Go\n' ;
10-
11- export const < % - project . name - % > HybridObject =
4+ const < % - project . name - % > HybridObject =
125 NitroModules . createHybridObject << % - project . name - % >> ( '<%- project.name -%>' ) ;
136
14- const < % - project . name - % > = < % - project . name - % > HybridObject
15- ? < % - project . name - % > HybridObject
16- : ( new Proxy (
17- { } ,
18- {
19- get ( ) {
20- throw new Error ( LINKING_ERROR ) ;
21- } ,
22- }
23- ) as < % - project . name - % > ) ;
24-
257export function multiply ( a : number , b : number ) : number {
26- return < % - project . name - % > . multiply ( a , b ) ;
8+ return < % - project . name - % > HybridObject . multiply ( a , b ) ;
279}
You can’t perform that action at this time.
0 commit comments