Only run propType checks on createElement & cloneElement not on every render.#350
Only run propType checks on createElement & cloneElement not on every render.#350tkh44 wants to merge 8 commits intopreactjs:masterfrom
Conversation
src/index.js
Outdated
|
|
||
| if (typeof componentClass !== 'function') return; | ||
| let name = ( | ||
| componentClass.prototype.displayName |
There was a problem hiding this comment.
this seems odd - was componentClass.displayName working before?
There was a problem hiding this comment.
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