From d0603655f2f97d3ffc498101aa3456b964c86380 Mon Sep 17 00:00:00 2001 From: Kim CHOUARD Date: Wed, 7 Feb 2024 19:43:15 +0100 Subject: [PATCH 1/2] Adding tailwind configuration example --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 7eb8777..141bb2b 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,49 @@ module.exports = { + +nativewind + +
+ +Click to here to see the config + +Due to the reanimated dependency and the extra babel configuration needed, add the following + +```js +module.exports = { + addons: [ + /*existing addons,*/ + { + name: '@storybook/addon-react-native-web', + options: { + modulesToTranspile: [ + 'react-native-reanimated', + 'nativewind', + 'react-native-css-interop', + ], + babelPresets: ['nativewind/babel'], + babelPresetReactOptions: { jsxImportSource: 'nativewind' }, + babelPlugins: [ + 'react-native-reanimated/plugin', + [ + '@babel/plugin-transform-react-jsx', + { + runtime: 'automatic', + importSource: 'nativewind', + }, + ], + ], + }, + }, + ], +}; +``` + +
+ + + ## Adding support for static assets and svgs From 7e344cdee76e46bc340cef1927ee63104a57630a Mon Sep 17 00:00:00 2001 From: Daniel Williams Date: Wed, 7 Feb 2024 19:18:19 +0000 Subject: [PATCH 2/2] fix: remove unneeded plugin --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 141bb2b..cc76eda 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ module.exports = { Click to here to see the config -Due to the reanimated dependency and the extra babel configuration needed, add the following +Nativewind requires some additional babel config to work correctly. You can see an example of this config below. ```js module.exports = { @@ -256,16 +256,7 @@ module.exports = { ], babelPresets: ['nativewind/babel'], babelPresetReactOptions: { jsxImportSource: 'nativewind' }, - babelPlugins: [ - 'react-native-reanimated/plugin', - [ - '@babel/plugin-transform-react-jsx', - { - runtime: 'automatic', - importSource: 'nativewind', - }, - ], - ], + babelPlugins: ['react-native-reanimated/plugin'], }, }, ],