ant-design/antd-mobile-samples

3.0 之后定制主题的写法

feige-2011 opened this issue · 2 comments

"@ant-design/react-native": "^3.1.5"
"react-native": "0.58.4",
ios

哪位老师帮忙写一下 3.0 之后定制主题的写法,谢谢啦!
3.0 之前我没用过,现在需要做夜间模式,文档中没有写主题怎么定制

同问

const path = require("path");
const { fixBabelImports, addLessLoader } = require("customize-cra");
const theme = require('./package.json').theme

module.exports = function override(config, env) {

    config = fixBabelImports('import', {
        libraryName: 'antd-mobile',
        style: true
    })(config)
    
    addLessLoader({
        modifyVars: theme
    })(config, env)

    return config;
};

这样配置后可以正常使用