React Component classes have some overhead that we can avoid by using a technique called stateless functional components.
A stateless functional component is just a function that returns a component. Props are passed in as the arguments to the function, and any React component tree can be returned.
We'll extract the Todo Header into a stateless functional component, and see how to pull that into a new file, and import and use it in the Todo List.
Summary of Content:
- Add a logout button to the Todo List header
- Make the logout button work by using screenProps to pass the logout action down the navigation stack.
- Extract the Todo Header into a stateless functional component
- Make a
TodoHeaderfile, put the new component there, and import and use it in the Todo List