-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Optimize Icon validation in development (and others?) #1184
Comments
The |
Until this is solved, @traverse suggested a great workaround in Gitter about this. You can skip prop validation entirely by simply using <Icon name='user' /> // will validate, is slow
<Icon className='user' /> // no validation, is fast Also note, propTypes are stripped in production automatically so this should only be a development issue. |
The performance of my app improved significantly when changing |
I don't think using Memoizing is the answer here. It is pretty minimal in this case. There should be a cache of input values and suggested results. After the first render, this would be nearly as fast as using className only. PRs welcome. |
I'd like to take this issue, if noone has started working on it yet. |
cache finding suggestions for prop words
cache finding suggestions for prop words
This should be a fairly easy fix, but it is quite important as I noticed non-negligible slowdown in one of our applications today until implementing local workarounds. Steps below, posting this as a reminder so we don't forget about it.
Steps
Icon
component.Expected Result
It should be super fast, the icon is a tiny component!
Actual Result
It can cripple applications in development when
propTypes
are not ignored due to expensive validation on supported icon names.Version
v0.64.2
Testcase
Not yet provided
The text was updated successfully, but these errors were encountered: