问题
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