我需要在本机反应中设置日期时间组件的样式。我正在使用Expo。
datetimepicker库通过命令安装:
npx expo install u/react-native-community/datetimepicker
根据 to this 日期时间组件的文档样式可以通过 app.json 文档的插件对象实现。但是,我收到以下错误:
"Package "@react-native-community/datetimepicker" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin
Cannot use import statement outside a module"
尝试使用 prebuild --clean 命令时对 app.json 进行更改后发生错误。 有什么想法可以解决这个问题吗?
您安装了哪个版本的
@react-native-community/datetimepicker
?
从您链接的文档中:
要使用此处记录的功能,您需要使用版本 >= 8.2.0 和 Expo Development 版本。