by Chris | Feb 10, 2023 | Javascript, React
I actually had this come up as an interview question once, and it was more of a theoretical discussion on how I would implement it, as opposed to actually having me white board it/live code it. I thought it would be good practice to re-visit this and implement a quick...
by Chris | Dec 21, 2021 | Javascript, React
Hooks were introduced to React in late 2018/early 2019 when React 16.8 was released. They’re a way of getting away from traditional class components by replacing them with functional components but they still allow us to leverage React’s life cycle methods...
by Chris | Feb 13, 2021 | Javascript, React
Conditional rendering is really what React is all about – Each component reacts to the state updating and as a result, we as developers want to render certain elements to the DOM based on these state changes. Enter conditional rendering. There are many different...
by Chris | Feb 8, 2021 | Javascript, React
tl;dr version using the useEffect hook: useEffect(() => { return () => console.log(“componentWillUnMount”) },[]) Hooks have REALLY grown on me as I continue to become more and more experienced developing with React. Gone are the days of needing to create...
by Chris | May 20, 2020 | Javascript, React
According to Wikipedia, a ‘thunk’ is: In computer programming, a thunk is a subroutine used to inject an additional calculation into another subroutine. Thunks are primarily used to delay a calculation until its result is needed, or to insert operations at...
by Chris | May 11, 2020 | Javascript, React
So typically a React component only re-renders when the state changes – but what if for some reason you want to have the component re-render when you pass it new props? Remember… State is local to the component, but props are passed down from the parent...