s-yadav / react-meta-tags

Handle document meta/head tags in isomorphic react with ease.
MIT License
226 stars 47 forks source link

Fix type error in handleChildrens() #29

Closed UwUnyaa closed 5 years ago

UwUnyaa commented 5 years ago

The lack of a null check in handleChildrens() can cause crashes in some cases (which I assume are related to asynchronous actions causing re-renders in the React tree of the application). This patch checks whether Element.querySelector() fails before trying to access properties expected in a DOM node in order to avoid a crash.

campmedia commented 5 years ago

Can this please be merged, I have the same issue. Props to @DoMiNeLa10

williamccrobinson commented 5 years ago

The changes to the src file work, but npm run compile needs to be run in order for this change to be propagated into the lib and dist folders respectively, otherwise it doesn't work when running this in production. Great work!

UwUnyaa commented 5 years ago

@williamccrobinson Sorry that I haven't noticed that I should've ran the script. I hope the PR is still fine. If it needs any changes, just let me know.

s-yadav commented 5 years ago

Looks good. I will release a new version with the changes soon.

s-yadav commented 5 years ago

Released in v0.7.4

UwUnyaa commented 5 years ago

@s-yadav Thanks, I'll have to upgrade packages in my project soon, and I'm glad I'll be able to upgrade your package to the newest version.