File tree Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 11import { StyleSheet , View } from "react-native" ;
22
3- import { specificity , StyleRegistry } from "react-native-css-nitro" ;
3+ import { multiply , specificity , StyleRegistry } from "react-native-css-nitro" ;
44import { Text } from "react-native-css-nitro/components/Text" ;
55
66StyleRegistry . addStyleSheet ( {
@@ -42,7 +42,7 @@ export default function App() {
4242 console . log ( "Pressed!" ) ;
4343 } }
4444 >
45- Hello, World!
45+ Multiply: { multiply ( 3 , 7 ) }
4646 </ Text >
4747 </ View >
4848 ) ;
Original file line number Diff line number Diff line change 1+ class CssNitro : HybridCssNitroSpec {
2+ public func multiply( a: Double , b: Double ) throws -> Double {
3+ return a * b
4+ }
5+ }
Original file line number Diff line number Diff line change 88 "androidCxxLibName" : " cssnitro"
99 },
1010 "autolinking" : {
11+ "CssNitro" : {
12+ "swift" : " CssNitro" ,
13+ "kotlin" : " CssNitro"
14+ },
15+ "Math" : {
16+ "cpp" : " HybridMath"
17+ },
1118 "HybridStyleRegistry" : {
1219 "cpp" : " HybridStyleRegistry"
1320 }
Original file line number Diff line number Diff line change 1+ import { NitroModules } from "react-native-nitro-modules" ;
2+
3+ import type { CssNitro } from "./CssNitro.nitro" ;
4+ import type { Math } from "./specs/Math.nitro" ;
5+
16export { StyleRegistry } from "./specs/StyleRegistry" ;
27export { useStyled } from "./native/useStyled" ;
38export * from "./native/specificity" ;
9+
10+ const CssNitroHybridObject =
11+ NitroModules . createHybridObject < CssNitro > ( "CssNitro" ) ;
12+
13+ const MathHybridObject = NitroModules . createHybridObject < Math > ( "Math" ) ;
14+
15+ export function multiply ( a : number , b : number ) : number {
16+ return CssNitroHybridObject . multiply ( a , b ) ;
17+ }
18+
19+ export function add ( a : number , b : number ) : number {
20+ return MathHybridObject . add ( a , b ) ;
21+ }
You can’t perform that action at this time.
0 commit comments