Skip to content

responsive design on size prop #322

@kirill-develops

Description

@kirill-develops

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions