Subscribe without children gives error
Using <Subscribe/> as in the example in the Readme gives the following error:
Error: Initialize(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
The above error occurred in the
<Initialize>component: in Initialize (created by Context.Consumer) in LoginStatus in div (created by RootElement) in RootElement in r in Unknown in Facebook in Provider
This is caused by Subscription calling Initialize without a children prop, and Initialize rendering children without checking if it exists (it should be required for Initialize, no?).
Could be fixed by either having Initialize return children || null or changing Subscribe to call Initialize with children set to null as default.
I'd be happy to provide a PR, but let me know which solution is preferred (my vote is on the latter..)
thanks I will check it
any update or how to work-around this?
You could have an empty array as children for the Subscribe component:
<Subscribe event="some_event" onChange={handleChange} children={[]} />