生成了项目后,我注意到了这样的文件夹结构:
folder结构图像
我的主要问题是:
如何将尾风CSS或本地风向CSS添加到使用Expo创建的React本机应用程序? npx npx create-expo-app@最新包含默认情况下包括babel.config.js?
我到目前为止尝试过的步骤:
babel.config.js
npx create-expo-app@latest
npx create-expo-app --example with-nativewind
任何将尾风CSS /本地风格CSS整合到我的React Antial应用程序中的任何指南都将不胜感激!
--example
→示例:起动器的列表
→替代方案:interialwindbabel.config.js
// babel.config.js (default)
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
// babel.config.js (nativewind)
module.exports = function (api) {
api.cache(true);
return {
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
};
};
→您还需要创建一个metro.config.js
如果决定手动安装本地风格,则该文件也通过幕后的博览会来处理,您可以通过创建自己的文件选择退出。