luqin / react-icheck

:radio_button: iCheck components built with React. Highly customizable checkbox, radio buttons and radio group.
https://luqin.github.io/react-icheck
177 stars 40 forks source link

Support server-side rendering #26

Closed alex-e-leon closed 8 years ago

alex-e-leon commented 8 years ago

@luqin fixes issue https://github.com/luqin/react-icheck/issues/25

I moved the navigator check to componentDidMount in order to avoid checking for navigator unless we're in a browser window.

In order to prevent react from complaining about the client and server renders being out of sync, I've made the default value for _mobile = false + I call forceUpdate after the componentDidUpdate methods.

jooj123 commented 8 years ago

+1

jesstelford commented 8 years ago

LGTM :+1: