Category: React

Redux Cycle

Action Creator (User)-> Action(Form) -> dispatch(Form handler) -> Reducers(Departments) -> State(Compiled shared department data) Analogy, Insurance Company: policy: Customer holds a policy, if bad stuff happens to them then we pay them claim: Customer had something bad happen to them, we need to pay them. Customer signs up for a Policy -> Form -> Form …

Custom Hooks

Custom hooks are a great way to avoid repeating yourself while writing code. Custom hooks will always use a primitive React hook. Its not for JSX. Each hook should have only one purpose, such as data-fetching from a specific api. Steps to take when creating reusable hooks Identify each line of code related to some …

Hooks in React

Hooks help writing reusable code. useState – Function that lets you use state in a functional component. inside your functional component, deconstruct an array and pass in 2 values, first value will be a getter function and second value will be a setter, then call the useState function and pass in the initial value as …