如何为 react-native-web 生成 class 名称而不是内联样式?

How to generate class names instead of inline styles for react-native-web?

我是 运行 使用 react-native-web 的 expo web build。我注意到它会生成内联样式,因此如果我呈现项目列表,每个项目都会重复样式。有没有办法让它生成一个唯一的类名,并像样式组件一样添加到头部?

重新访问并意识到这是因为我使用的组件没有在内部使用 StyleSheet.create api 调用,它将在 [= 上生成原子 css 类 16=]。将常规对象设置为样式 属性 只会生成内联样式。有关详细信息,请参阅我在此处发布的问题:

https://github.com/akveo/react-native-ui-kitten/issues/1266