Peter Chang
Aug 24, 2017 · 1 min read

Thx Israel, it is so true that there is risk using context.

Hum, as the research I did, using context may or may not influence the scope functions, such as componentDidMount, componentWillMount, componentShouldUpdata etc. That is why it is not suitable to use context to handle dynamic data which passed to child components back and forward.

My use-case is using context to manage css(theme) style, which is only given once during the time that the web is opened, and it is never change.

)
    Peter Chang

    Written by

    Algorithm Artist and tech blogger from Macau, Front-end Engineer in @Oriente. Specialist in Javascript, React and Node.js. https://goo.gl/gdkt3x