You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Expo项目未使用shadow属性却收到shadow*样式弃用警告的问题求助

Expo项目未使用shadow属性却收到shadow*样式弃用警告的问题求助

大家好,我昨天刚用最新版本创建了一个Expo项目,现在遇到了一个特别困惑的问题——我自己的代码里完全没有使用任何shadow*相关的样式属性,但控制台却反复弹出一堆弃用警告。

完整的警告日志如下:

λ WARN "shadow*" style props are deprecated. Use "boxShadow".
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
console.warn (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\@expo\cli\src\start\server\serverLogLikeMetro.ts:152:21)
warnOnce (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\modules\warnOnce\index.js:24:13)
preprocess (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\preprocess.js:136:13)
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
console.warn (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\@expo\cli\src\start\server\serverLogLikeMetro.ts:152:21)
warnOnce (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\modules\warnOnce\index.js:24:13)
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
console.warn (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\@expo\cli\src\start\server\serverLogLikeMetro.ts:152:21)
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
console.warn (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\@expo\cli\src\start\server\serverLogLikeMetro.ts:152:21)
warnOnce (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\modules\warnOnce\index.js:24:13)
preprocess (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\preprocess.js:136:13)
compileAndInsertAtomic (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:
λ WARN "shadow*" style props are deprecated. Use "boxShadow".
console.warn (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\@expo\cli\src\start\server\serverLogLikeMetro.ts:152:21)
warnOnce (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\modules\warnOnce\index.js:24:13)
preprocess (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\preprocess.js:136:13)
compileAndInsertAtomic (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:56:34)
forEach (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:99:26)
preprocess (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\preprocess.js:136:13)
compileAndInsertAtomic (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:56:34)
forEach (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:99:26)
compileAndInsertAtomic (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:56:34)
forEach (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:99:26)
Function.create (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:87:23)
forEach (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:99:26)
Function.create (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:87:23)
Function.create (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\react-native-web\dist\exports\StyleSheet\index.js:87:23)
factory (C:\Users\Houssen D. Aly\Desktop\mobile_movie_app\node_modules\expo-router\build\views\Sitemap.js:144:42)

我已经翻遍了自己写的所有组件和样式文件,确认没有手动添加过shadowColor、shadowOffset这类shadow*属性,但警告就是停不下来。有没有大佬能帮我分析下这是哪里出了问题?或者有没有可行的解决办法呢?

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 09:38:10