- Passing event handlers as Props
- event handler naming conventions
- Adding form inputs
- Submitting inputs
- Performing simple input validation
- Rendering components using
map()
key
property
- Rules of Hooks
- Life cycles
- Effects for synchronization
- Usage of
useEffect
- dependencies of effect (onMount)
- cleanup after effect
- Calling async APIs using effects
- Implementing initial page load with loading wheel
- Create a new component called
ClickCounter
. - Use the
useState
hook to manage acount
state variable. - Implement an
onClick
event handler function that increments thecount
. - Render a button and display the current value of
count
.
- Create a new component called
SimpleForm
. - Use the
useState
hook to manage the state of form inputs. - Create input fields for the form (e.g., name, email, message).
- Implement a
handleSubmit
function to handle form submission. - Render the form inputs and a submit button.
- Create a new component called
TodoList
. - Use the
useState
hook to manage an array of todo items. - Implement a function to add a new todo item to the array.
- Implement a function to remove a todo item from the array.
- Render a list of todo items using the
.map
method, ensuring each item has a uniquekey
prop. - Render an input field to add new todos and buttons/functionality to remove todos.
- Create a new component called
Clock
. - Use the
useState
hook to manage the current time. - Use the
useEffect
hook to set up an interval that updates the time every second. - Implement the cleanup function in
useEffect
to clear the interval when the component unmounts. - Render the current time in the component.
- Create a new component called
DataFetcher
. - Use the
useState
hook to manage the data, loading, and error states. - Use the
useEffect
hook to fetch data from a public API when the component mounts. - Implement loading and error states in the component's JSX.
- Render the fetched data when it's available.
- Create a new component called
WindowResizer
. - Use the
useState
hook to manage the window size. - Use the
useEffect
hook to set up an event listener for theresize
event. - Update the window size state whenever the
resize
event is triggered. - Implement the cleanup function in
useEffect
to remove the event listener when the component unmounts. - Render the current window size in the component.