Bobert Ross
Bobert Ross

Reputation: 93

How to use existing amplify backend in both react and react native

I have setup a simple Amplify backend API and connected it to a React Native frontend. Now I want to connect it to a React frontend.

Could I extract all of the Amplify code into its own project to be used by both frontends? I want to avoid code duplication as much as possible. Has anyone done this before?

Upvotes: 1

Views: 1038

Answers (2)

v.ng
v.ng

Reputation: 794

Despite React and React Native can share the same Amplify backend, according to my research, if your application has federated sign in, you must create two different stages for them, because of the Sign-in and Sign-out redirection url, React takes http://xxxx but React Native takes myapp://.

Upvotes: 1

Alex
Alex

Reputation: 842

This is a supported feature. You can read all about it in the docs about multiple front-ends

Upvotes: 2

Related Questions