buttons / react-github-btn

:octocat: Unofficial github:button component for React.js
https://buttons.github.io
BSD 2-Clause "Simplified" License
62 stars 8 forks source link

Ensure node still exists when promise resolves #13

Closed bhj closed 3 years ago

bhj commented 3 years ago

Hi, thanks for this and github-buttons!

I added a simple check for an edge case where the node might not exist by the time the import promise resolves. In my case, the buttons are mounted once a route is signed into, but then there is a potential immediate redirect, in which case React has mounted and unmounted the buttons before the import resolves, by which time this._.current is null.

ntkme commented 3 years ago

Thanks! Just released 1.2.1.