appleboy / react-recaptcha

A react.js reCAPTCHA for Google
https://www.google.com/recaptcha/intro/index.html
BSD 3-Clause "New" or "Revised" License
634 stars 97 forks source link

responsive design on size prop #322

Open kirill-develops opened 1 year ago

kirill-develops commented 1 year ago

Hey there,

I have a reCaptcha element as below and have set a ternary condition in the size prop to change the size based on a breakpoint however it does not seem to re-render. The isMobile variable is definitely updating. Wondering if there is a particular way to handle this with react-recaptcha: <Recaptcha sitekey={process.env.GATSBY_GOOGLE_CAPTCHA_SITEKEY} render="explicit" size={isMobile ? 'compact' : 'normal'} onloadCallback={recaptchaLoaded} verifyCallback={recaptchaVerified} expiredCallback={recaptchaReset} />

thanks for the great snippet!