segmentio / ui-box

Blazing Fast React UI Primitive
MIT License
1.07k stars 55 forks source link

Updates box ref proptype #59

Closed andycarrell closed 4 years ago

andycarrell commented 4 years ago

We are seeing a prop-type error with Evergreen Pane, which uses ui-box for innerRef.
Following this answer from stack overflow, it looks like we need to specify instanceOf(Element).

Edit

As pointed out by @Rowno this won't work for SSR - further down in the same stack overflow answer it recommends checking for the existence of Element - which should solve for SSR and ava testing.

~The follow on effect of this is Element isn't defined for ava tests - then, following this recommendation, I've added the window package to patch Element.~

Alternatives

mshwery commented 4 years ago

Box no longer supports innerRef so this is now obsolete.