React-native native-base :将 v2 主题与 v3 一起使用

问题描述 投票:0回答:1

所以,我最近从 v2 升级到 v3

native-base

对于 v2,我正在使用这个:

<StyleProvider style={getTheme(material)}>

我用

getTheme from '../../native-base-theme/components'
material from '../../native-base-theme/variables/material'

但是对于 v3,我需要使用这个:

const newColorTheme = {
   brandPrimary: "#FFD100",
   brandInfo: "#62B1F6",
   brandSuccess: "#5cb85c",
   brandDanger: "#d9534f",
   brandWarning: "#f0ad4e",
   brandDark: "#000",
   brandLight: "#f4f4f4",
};
const theme = extendTheme({ colors: newColorTheme });

<NativeBaseProvider theme={theme}>

(newColorTheme 是一个例子)

我无法使用 v2n 中以前的主题方法,这是一个问题,因为我的整个应用程序都使用它......

有人作为解决方案? 谢谢!

react-native native-base
1个回答
0
投票

你找到解决办法了吗,我也有同样的问题

© www.soinside.com 2019 - 2024. All rights reserved.