Download local by flywheel
Connect to wpengine
Fetch ofw-dev
visit /product-search/ and make sure its visible
In the , the difference between and lies in their purpose and usage:
- : Define custom logic that can modify the state or trigger side effects. These are triggered by user events like button clicks or form submissions (e.g., updating the context state).
- : Get executed whenever the context changes, reacting to state updates. They typically log or perform read-only operations, like logging values or updating the UI based on new state.
In short: modify the state, while respond to state changes.
In the , both and store and manage data, but they differ in scope and usage:
- : Refers to the current value or status of a specific property in a local scope, typically tied to a component or action. It can be changed by actions (e.g.,
state.text
). - : A shared object accessible across multiple components and actions. It provides a way to manage and pass data globally without relying on props.
In essence, to a component, while and shared across components.
Passcode: 1+yd5iW5