Skip to content

Commit

Permalink
feat: migrate to nativewind v4
Browse files Browse the repository at this point in the history
  • Loading branch information
yjose committed Feb 1, 2024
1 parent a6fe72e commit 3b10846
Show file tree
Hide file tree
Showing 45 changed files with 667 additions and 475 deletions.
6 changes: 4 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: [
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
'nativewind/babel',
],
plugins: [
[
'module-resolver',
Expand All @@ -24,7 +27,6 @@ module.exports = function (api) {
],
},
],
['nativewind/babel', { mode: 'compileOnly' }],
'react-native-reanimated/plugin',
],
};
Expand Down
3 changes: 3 additions & 0 deletions global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
6 changes: 4 additions & 2 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');

module.exports = getDefaultConfig(__dirname);
const config = getDefaultConfig(__dirname);

module.exports = withNativeWind(config, { input: './global.css' });
1 change: 1 addition & 0 deletions nativewind-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="nativewind/types" />
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"expo-system-ui": "~2.9.3",
"i18next": "^22.5.1",
"lodash.memoize": "^4.1.2",
"nativewind": "^2.0.11",
"nativewind": "^4.0.23",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "^3.1.4",
Expand All @@ -80,6 +80,7 @@
"react-native-svg": "14.1.0",
"react-native-web": "~0.19.10",
"react-query-kit": "^1.5.2",
"tailwind-variants": "^0.1.20",
"zod": "^3.22.4",
"zustand": "^4.5.0"
},
Expand Down
Loading

0 comments on commit 3b10846

Please sign in to comment.