cyan33 / learn-react-source-code

Build react from scratch (code + blog)
208 stars 23 forks source link

Fixed example code #16

Closed anothertempore closed 6 years ago

anothertempore commented 6 years ago

At update.md, I think the parameter of instantiateComponent() is Element not Component, so I fixed it.

const nextRenderedComponent = instantiateComponent(nextRenderedComponent)

and shouldUpdateComponent():

if (shouldUpdateComponent(prevRenderedComponent, nextRenderedComponent)) {

}
cyan33 commented 6 years ago

Nice catch! Thanks for the fix.