react-hooks icon indicating copy to clipboard operation
react-hooks copied to clipboard

Check for document in environment before accessing

Open mdarens opened this issue 5 years ago • 2 comments

Fixes #4

mdarens avatar Mar 21 '19 21:03 mdarens

@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! 💖

yeskunall avatar Mar 22 '19 01:03 yeskunall

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.

mdarens avatar Mar 22 '19 15:03 mdarens