What are side effects in React and how can they affect component output?
Side effects are operations that interact with external systems (like browser APIs, remote APIs, or HTML elements).
They can affect component output because they’re used to interact with third-party APIs, measure HTML elements, or work with JavaScript functions like timers.
How do you initiate state from localStorage?
const App = () => {
.. const [searchTerm, setSearchTerm] = React.useState( localStorage.getItem('search') || 'React' );
... );