drcmda / react-contextual

🚀 react-contextual is a small (less than 1KB) helper around React 16s new context api
MIT License
642 stars 23 forks source link

Context not triggering subscriptions / triggering with undefined. #19

Closed MauriceButler closed 6 years ago

MauriceButler commented 6 years ago

I havnt had the chance to look into this deeper but a simple example of subscribing to 2 stores is failing.

sample code https://codesandbox.io/s/n3yok829n4

If you click the up and downs buttons it will not render correctly and sometimes throw due to an undefined store being passed to the mapStateToProps function.

Ill try to dig into it and find a cause tomorrow but if there is something you can see I am doing incorrectly please set me straight :smile:

drcmda commented 6 years ago

@MauriceButler thanks for notifying, the undefined thing was a bug, this is fixed now, but the first one didn't happen before. Very strange. I'm on it: https://github.com/facebook/react/issues/12604

drcmda commented 6 years ago

@MauriceButler it's fixed in 4.0.4.

MauriceButler commented 6 years ago

Thanks @drcmda not bad to raise and issue, have it upstreamed, discussed and fixed before I wake up 😛