Module 5 & 6 App Dev
Module 5 & 6 App Dev
Application Development
and Emerging Technologies
state is an object that stores
component-specific data that
can change over time. Unlike
props, which are immutable
and passed from a parent
component, state is managed
within the component itself and
can be updated dynamically,
triggering a re-render.
Local state refers to state
variables that exist within a
specific component and
affect only that
component. It is not shared
with other components
unless explicitly passed as
props.
Global state refers to a state that
is shared across multiple
components, making it accessible
from anywhere in the app.
Syntax of
useEffect
It is commonly used
when:
• The state involves
multiple sub-
values.
The useReducer hook is an
• The next state
alternative to useState, depends on the
useful for managing previous state.
complex state logic in React • Actions need to be
Native applications. explicitly defined
(like Redux but
inside a
component).
• state: The current state value.
• dispatch(action): Function used to update state.
• reducer(state, action): A function that takes the current state
and an action, then returns the new state.
• initialState: The starting state value
Redux is a state
management library that
helps manage global state
in large applications. It
provides a centralized store,
making it easier to manage
and share data across
multiple components.
Store
Holds the entire application state.
Actions
Describe what should happen
Reducers
Specify how the state should change
Dispatch
Sends actions to update the state
The Context API is a
built-in feature in
React that enables
state sharing across
multiple components
without prop drilling.
ITC06
Application Development
and Emerging Technologies
API (Application Programming
Interface) is a set of rules and
protocols that allows different
software applications to
communicate with each other.
Library/API Frameworks
Used within a programming
language