Login not working in React

Hey,

Has anyone else connected Memberstack with React js? There is a bug where, if you route to the login page via react-router it will not recognize the login action, and treats the form as a normal submit.

Anyone experience this

Hi @Bharath_Menan_Sub ,

We don’t have an official React integration just yet. That said, we have had some users successfully use MemberStack in their react apps.

I’ll ask around to see if I can find some information to help you here.

@aziaziazi do you have any ideas here?

@Bharath_Menan_Sub I don’t have any experience using MemberStack with React, but this might be a good place to start: Whenever I have custom JavaScript containing conditional statements on any of my pages, the MemberStack JavaScript file fails to run. This is due to a combination of the order in which the MemberStack JS runs in relation to your other JS, and also the nature of if/else conditional statements. If you’re using conditional routing with React Router, perhaps the MemberStack login script never runs because the script stops running as soon as it hits the first qualifying if/else condition in your React Router?

If this is causing the issue, you should be able to circumvent this by modifying your React Router to contain only switch/case statements rather than if/then statements.