davidtheclark/react-aria-tabpanel

Does not render isomorphically

jamesjjk opened this issue · 4 comments

Hi nice build, but it does not render isomorphically.. the document is not available when rendering serverside. CreateManager is called on componentWillMount which calls focus-group. Consider using componentDidMount which is called client side only.

https://facebook.github.io/react/docs/component-specs.html

react-aria-tabpanel/node_modules/focus-group/index.js:18
  document.addEventListener('keydown', this._boundHandleKeydownEvent, true);
  ^

ReferenceError: document is not defined

Open to a PR. I am not personally too interested in dealing with the complexities of isomorphism for the questionable gains (no gains, really, for the app that I work on). But sounds like an easy fix!

@davidtheclark Hi David, will do a PR. Its a straightforward fix, need to call activate of focusgroup in componentdidmount lifecycle method. It would seem a shame that the only aria tabs implementation would not work isomorphically..

Fixed by #9, released in 4.1.0.