Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compatibility): change react and reactdom to peer dependencies #410

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

f8k8
Copy link
Contributor

@f8k8 f8k8 commented Oct 25, 2018

Description

Including React and ReactDOM as dependencies was causing the latest version to no longer function when used with React 0.14 and 15.0. See #405. This was due to a breaking change in the way React handles the callback for setState (see here: https://stackoverflow.com/a/48375265/1054890)

The fix was to remove React and ReactDOM as direct dependencies and move them to being peer dependencies. This should be fine, as any project using this component should already have React / ReactDOM as a direct dependency.

Because they are now peer dependencies, the example has been updated to use the versions available via the React CDN links.

Checklist

  • All tests passing
  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary
  • Commits and PR follow conventions

React changed the way setState callbacks are handled in
version 16. When using react-geosuggest with React < 16
the callbacks were no longer called. In order to maintain
compatibility with React 0.14 and 15, React and ReactDOM
have been moved to peer dependencies.

Closes ubilabs#405
Copy link
Contributor

@ro-ka ro-ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run npm install as in the other branch. Tests fail if package.json and package-lock.json are not in sync.

rollup.browser.config.js Show resolved Hide resolved
rollup.example.config.js Show resolved Hide resolved
rollup.module.config.js Outdated Show resolved Hide resolved
@f8k8
Copy link
Contributor Author

f8k8 commented Oct 28, 2018

Indentation and packages should be fixed now.

@ro-ka ro-ka merged commit b4a8b40 into ubilabs:master Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants