AWS Amplify: How to setup { withConnector } component?

随声附和 提交于 2019-12-23 05:17:07

问题


Following the Amplify Quick Start I set up an AWS Mobile App with the awsmobile-cli:

awsmobile init
awsmobile user-signin enable
awsmobile push

In my react App I configured Amplify like so (I also tried manual configuration):

import Amplify from 'aws-amplify';
import aws_exports from '../../aws-exports.js';
Amplify.configure(aws_exports);
import { withAuthenticator } from 'aws-amplify-react';

...
export default withAuthenticator(App);

This Code shows me the Cognito UI, but on any action, I take the following error appears:

No userPool

How do I properly connect the Amplify withConnector component with my App's userPool?


P.S. Yesterday evening my app was working flawlessly. Today I only performed some minor changes and cannot explain this behavior.


回答1:


Can you check if there is aws-amplify under your node_modules/aws-amplify-react/node_modules. Sometimes npm will install it twice and caused some problem



来源:https://stackoverflow.com/questions/49435216/aws-amplify-how-to-setup-withconnector-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!