, styles: T): React.ReactElement | null;
100 | displayName?: string;
101 | }
102 |
103 | /**
104 | * Convenient higher-order component for attaching `useStyles` hook to components
105 | */
106 | export const connectStyles =
107 | (
109 | render: WithStylesRenderFunction => {
111 | const WrappedComponent = (props: P) => {
112 | const styles = useStyles();
113 | return render(props, styles);
114 | };
115 | WrappedComponent.displayName = `withStyles(${
116 | render.displayName || render.name || 'Component'
117 | })`;
118 | return WrappedComponent;
119 | };
120 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-swag-styles",
3 | "version": "0.2.2",
4 | "description": "Swag Styles",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-swag-styles.podspec",
17 | "!lib/typescript/example",
18 | "!android/build",
19 | "!ios/build",
20 | "!**/__tests__",
21 | "!**/__fixtures__",
22 | "!**/__mocks__"
23 | ],
24 | "scripts": {
25 | "test": "jest",
26 | "typescript": "tsc --noEmit",
27 | "lint": "eslint \"**/*.{js,ts,tsx}\"",
28 | "prepare": "bob build",
29 | "release": "release-it",
30 | "example": "yarn --cwd example",
31 | "pods": "cd example && pod-install --quiet",
32 | "bootstrap": "yarn example && yarn && yarn pods"
33 | },
34 | "keywords": [
35 | "react-native",
36 | "ios",
37 | "android"
38 | ],
39 | "repository": "https://github.com/ef-eng/react-native-swag-styles",
40 | "author": "Sirui Li