Migrate from 1.0 to 2.0
Version 2.0 introduced breaking changes to simplify the API and improve the language configuration system. This guide will help you update your code to work with the new version.Breaking Changes
Language Configuration
Before (v1.0):Migration Steps
Remove global configuration
Remove any calls to
ReCAPTCHA.configure() that set lang or removeOnUnmount options.Update language prop
Replace
options.lang configuration with the hl prop directly on the <ReCAPTCHA> component.Why These Changes?
The
removeOnUnmount option was only useful for language changes, which are now handled more elegantly through the hl prop. This simplifies the API and makes language configuration more React-like by using props instead of global configuration.Additional Resources
- See the Component Props documentation for all available props
- Check the Changelog for a complete list of changes in v2.0
- Review the Basic Usage guide for updated examples