Question: How to skip checking on development (or conditionally)?
Like what's the cleanest way to disable it during development or staging?
Something like:
<form onSubmit={onSubmitWithReCAPTCHA}> <ReCAPTCHA ref={recaptchaRef} size="invisible" sitekey="Your client site key" skip={process.env.NODE_ENV !== 'production'} /> </form>
react-google-recaptcha version: 2.1.0
Have a try of the code below?
{'development' === process.env.NODE_ENV && <ReCAPTCHA />}
I don't understand how that's supposed to work. can you show a full example?
My bad. Assume you're using function components
function myFun() { // ... return( <> { 'development' === process.env.NODE_ENV && <ReCAPTCHA />} </> ) }
It's called conditional rendering, here's the reference to the official doc
https://reactjs.org/docs/conditional-rendering.html