-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Use React.PureComponent instead of pure-render-decorator #144
Comments
just in case it helps, here's the ruby script I used to make this change in our codebase. (Note that it isn't designed to be robust, it might not work in cases with multiple decorators, etc.) You want to run it in your root files = Dir['**/*.{ts,tsx}']
files.each do |f|
lines = File.readlines(f)
lines.delete_if { |line| line =~ /import|require/ && line =~ /pure-render-decorator/ }
# remove line with decorator, change if you use a different import name
while decorator_index = lines.find_index { |line| line =~ /@PureRender/ }
lines[decorator_index + 1].sub!(/Component</, 'PureComponent<')
lines.delete_at(decorator_index)
end
File.write(f, lines.join(''))
end Also, doing this means the peerDependencies on React will have to be bumped to |
🔥 breaking change because it requires React >= 15.3! |
In package.json react requirement is already >= 15.5.1, is this still beraking change? |
@betalb no, the blueprint/packages/core/package.json Line 20 in 3782d6d
|
docs: https://facebook.github.io/react/docs/react-api.html#react.purecomponent
shouldComponentUpdate
to opt out of pure renderingthis will require rewriting the tslint rule which enforces pure componentsthis seems to have gotten lost somewhere in the last few months...The text was updated successfully, but these errors were encountered: