github上的问题帖:https://github.com/GeekyAnts/NativeBase/issues/772
import * as React from "react";
import {Container, StyleProvider,Text} from "native-base";
import getTheme from './native-base-theme/components';
import dark from './native-base-theme/variables/dark';
import day from 'native-base-theme/variables/day';
@observer
export class Screen extends React.Component {
render() {
let theme = getTheme(mobxStore.getViewMode == 'dark'?dark:day)
return (
<StyleProvider style={theme}>
<Container>
<Text>Some Text</Text>
</Container>
</StyleProvider>
)
}
}
切换无效
解决办法
针对 native-base-shoutem-theme 的补丁 https://github.com/GeekyAnts/theme/pull/1
根据描述,更改native-base-shoutem-theme模块(node-module/native-base-shoutem-theme)下 src中 connectStyles文件