-
-
Notifications
You must be signed in to change notification settings - Fork 126
Only run propType checks on createElement & cloneElement not on every render. #350
Conversation
src/index.js
Outdated
|
|
||
| if (typeof componentClass !== 'function') return; | ||
| let name = ( | ||
| componentClass.prototype.displayName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems odd - was componentClass.displayName working before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests would fail. It was returning the function you use to construct the pfcs. This was before I was testing on 8. I'll adjust and try again.
- moved the validation call into createElement/cloneElement to match React - added test for cloneElement preactjs#348
|
All the tests pass, but there are missing tests for children as function. I tried to get this covered, but the tests would run as expected in the browser but not in phantom. The proptype checking for children as a function (I think any "single child" case) is proving to be difficult. |
|
Looking good - will test this out locally and see if I can make a children as function test work. |
- moved the validation call into createElement/cloneElement to match React - added test for cloneElement preactjs#348
|
Rebased after #359 landed. |
|
Odd that it's still noting merge conflicts in GH's UI. |
|
I will close this PR and and redo it. |
|
New PR opened on #370 |


This is a good start towards getting perf up. I'm still having some issues on startup when tons of elements are created, but it is much better than before.
#348