2018, ReactJS Recap
Since last time I opened reactjs.org, it has been a long time.
const ThemeContext = React.createContext('light');
Then the ThemeContext will have Provider and Consumer ready to use.
Personally thought, not good to use.
This is a good thing, and easily integrated with redux saga
This is a good thing, something I need to return a list of dom elements, but I dont want to wrap it into a div.
Can do it using
return <> <div>I am A</div> <div> I am B </div> <>
- HOC, Higher-Order Component
Similar to Proxy Pattern, I dont use at least
- Refs and DOM
refs API is changed to
React.createRef(). Now define refs in constructor and then use it using
Another way to use it is called
callback refs, I personally use this pattern more.