-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
shallowCompare not set on React.addons (npm version 0.13.3) #4315
Comments
Thanks for quick response. Any suggestions for how to best make use of |
This is unfortunate. We are thinking of adding a flag to React components that denotes whether they are pure (cc @sema). Once we have this I will update the codemod accordingly. @pocketjoso I would suggest, in your main component (or any side-effectful component that sets up your environment), to manually add React.addons.shallowCompare. You'll be able to remove this once we ship a React version that exports this function or once we add the flag I mentioned before. |
@cpojer It is unfortunate indeed, because it makes codemod a lot less useful out of the box. I will monkeypatch React.addons to add the shallowCompare function. |
According to release notes shallowCompare is now separate package react-addons-shallow-compare. @cpojer Can we expect codemod update that use this package instead of Thanks! |
Oh, I missed this! Yeah absolutely, this shouldn't be that big of a deal, except of course adding a require/import at the right location is still hard :) |
I'm quite swamped with work on jest at the moment. Is this something you'd be interested in sending a PR for, @jardakotesovec ? |
@cpojer Unfortunately also swamped with more pressing stuff. |
Moved to reactjs/react-codemod#2 |
According to the docs for react-codemod, React > 0.13.x should include
React.addons.shallowCompare
(which is used by thePureRenderMixin
transformation) - but when installingreact
from npm this is not the case. In the locally installed react node modulelib/ReactWithAddons
is missing this line. Is the npm package not up to date, or what else is wrong here?If it matters:
react
:0.13.3
npm
:2.12.1
OSX
(I know this error will go away with
0.14.x
, but we can't really upgrade to that while it's in beta..The text was updated successfully, but these errors were encountered: