react-hooks
react-hooks copied to clipboard
Check for document in environment before accessing
Fixes #4
@mdarens thank you for the PR! I like it.
It looks like react-dom-status-hook
might also be affected by the problem you mentioned in #4. Do you mind making the same change here as well?
https://github.com/21kb/react-hooks/blob/ae764604518e34b61b2f409c8533b3f38ee7c7d3/packages/react-dom-status-hook/src/index.ts#L7-L9
If however you need this fixed urgently, ping me, and I’ll go ahead and merge this. Thanks for the help so far! 💖
I can look at that one too but as you may have noticed by now I goofed on the TS syntax & didn't annotate the new initial state as a function which returns an interface, so I just implemented it in plain ES for my needs.