小编Y.H*_*nni的帖子

无法覆盖具有自定义主题的默认Amplify withAuthenticator样式

我正在尝试在我的React Native应用程序中自定义AWS WithAuthenticator HOC的样式。我逐步遵循了Amplify 文档。但是,应用程序将继续呈现默认样式(橙色按钮),而不是预期的自定义颜色。

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Amplify from '@aws-amplify/core';
import config from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react-native';
import { AmplifyTheme } from 'aws-amplify-react-native';

// custom colors for components 
const Mybutton = Object.assign({}, AmplifyTheme.button, { backgroundColor: '#000', });
//console.log('My own design: ', Mybutton)
const MyTheme = Object.assign({}, AmplifyTheme, { button: Mybutton });


class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text>You are now …
Run Code Online (Sandbox Code Playgroud)

react-native aws-amplify

5
推荐指数
1
解决办法
318
查看次数

标签 统计

aws-amplify ×1

react-native ×1