Skip to main content

62 docs tagged with "Hooks API"

View All Tags

!snippet usecallback

!snippet usecallback. Topics on: !snippet useCallback() for deletable todo app. Read more: React, React API, Hooks API, Memoizing Hook, Use Callback | Dev Wiki

!snippets useEffect

!snippets useEffect. Topics on: !snippet useEffect log window dimensions on resize what is the purpose of a cleanup function here?, !snippet disable eslint deps

Calling Order

Calling Order. Topics on: Linked List, Calling Order is implicitly defined by order of Hook written in code, which is added to Linked List of Fiber. Read more:

Cleanup Function

Cleanup Function is defined as: function call on Unmount, via return function from useEffect(). Topics on: Cleanup Function used to prevent Memory Leak, AbortCo

Custom Hook

Custom Hook is defined as: user defined Hook to consume Library Hook & reuse stateful logic. Topics on: usehooks.com, useToggle(), useRouter(), useEventListener

declare FC with hooks

declare FC with hooks. Topics on: !snippet signature for FC with Hook, return(...JSX). Read more: React, React API, Hooks API, Hook|FullStack Wiki by Roger J

Dependency

Dependency is defined as: any Variable local to FC Scope to control Hook Trigger. Topics on: Variable inside Scope of hook is not relevant Dependency. Read more

Deps Array

Deps Array is defined as: Dependency[] to pass as last Argument to Trigger Hook. Topics on: Deps Array applies to useEffect(), useLayoutEffect(), useMemo() & us

dynamic value for initial useState()

dynamic value for initial useState(). Topics on: props, initializer function. Read more: React, React API, Hooks API, Stateful Hook, Use State, Initial|Dev Wiki

Effect

Effect is defined as: Callback Function to run inside function, under certain conditions. Topics on: . Read more: React, React API, Hooks API, Effect Hook, Effe

Effect Hook

Effect Hook is defined as: (typeof) Hook to run Effect inside Component at different stages of Component Lifecycle. Topics on: useEffect(), useLayoutEffect(), u

External System

External System is defined as: e.g. DOM API element, Global Object, fetch request. Topics on: . Read more: React, React API, Hooks API, Effect Hook, Side Effe

Hidden Dependency

Hidden Dependency is defined as: External outer scope variable or invoking external function. Topics on: Hidden Dependency can be moved into input Argument to t

Hook

Hook is defined as: Specialized Function Functional Programming extends FC with Lifecycle Method & persistent state. Topics on: Specialized Function to 'hook' i

Hooks API

Hooks API is defined as: React API to make React more Functional Programming. Topics on: Hook, Custom Hook, Stateful Hook, Effect Hook, Memoizing Hook, Library

initial

initial is defined as: value used to setup first instance render, ignored on re-render. Topics on: static initial values for useState(), dynamic value for initi

Initialization Argument

Initialization Argument is defined as: Argument pass to Initialization Function. Topics on: . Read more: React, React API, Hooks API, Stateful Hook, Use Reducer

Initialization Function

Initialization Function is defined as: function pass as Initialization Argument to useReducer() to generate Initial State for Reducer. Topics on: . Read more: R

initializer function

initializer function is defined as: set value to result of calculation. Topics on: pass function reference but do not invoke it with (), pass Initializer Functi

Lazy Initial value

Lazy Initial value is defined as: function pass as Parameter into useState(), to assign return value as Initial State value, on first-call only. Topics on: Lazy

Library Hook

Library Hook is defined as: (typeof) advanced Hook for use in larger component libraries & modules. Topics on: useDebugValue, useImperativeHandle, userInsertion

Linked List

Linked List is defined as: to keep track of Calling Order. Topics on: . Read more: React, React API, Hooks API, Hook, Calling Order|FullStack Wiki by Roger J

Memo()

Memo() is defined as: React function from useMemo() API for Memoization of any function !snippet for addition. Topics on: . Read more: React, React API, Hooks

Memoization of any value

Memoization of any value. Topics on: to avoid expensive recalculations, to maintain Referential Equality, !snippet useMemo() to memoize filtering. Read more: Re

Memoization of Component

Memoization of Component. Topics on: used to optimize Reconciliation by skipping any JSX comparison which saves time, !snippet Memo() with sub-component in todo

Memoizing Hook

Memoizing Hook is defined as: (typeof) Hook to Memoization for better perf by avoid repeat calculations. Topics on: useMemo(), useCallback(), useId(). Read more

Passive Effect

Passive Effect is defined as: Effect invoked through passive event. Topics on: Dispatch, Render, Commit. Read more: React, React API, Hooks API, Effect Hook, Si

Passive State

Passive State is defined as: persistant state NOT trigger re-render on update. Topics on: . Read more: React, React API, Hooks API, Stateful Hook, Use Ref, Pass

Run Effect on specific renders

Run Effect on specific renders is defined as: call useEffect() with relevant data in Deps Array. Topics on: only update when title changes; where title change i

Run Effect once onMount

Run Effect once onMount is defined as: call useEffect() with empty Deps Array. Topics on: . Read more: React, React API, Hooks API, Effect Hook, Use Effect, Dep

Run Effect with async await Fetch API

Run Effect with async await Fetch API. Topics on: ⚠ Effect callbacks are synchronous to prevent race conditions. Put the asyn function inside.. Read more: Reac

setter

setter is defined as: function to set new value; !convention prefix set* to value name. Topics on: !gotcha Referential Equality - do not mutate Array or Object

Side Effect

Side Effect is defined as: Effect with external Hidden Dependency that read/writes to External System. Topics on: External System, Passive Effect, Hidden Depend

Stable Variable

Stable Variable is defined as: Variable constant with each render. Topics on: . Read more: React, React API, Hooks API, Deps Array, Variable | Full-Stack Wiki

Stateful Hook

Stateful Hook is defined as: (typeof) Hook to add state to FC. Topics on: useState(), useReducer(), useRef(), useContext(), userDeferredvalue(), useTransition()

static initial values for useState()

static initial values for useState(). Topics on: true/false, empty string '', null. Read more: React, React API, Hooks API, Stateful Hook, Use State, Initial

useAsync()

useAsync() is defined as: async Custom Hook to return value, error, status of Data Fetch. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Asyn

useAuth()

useAuth() is defined as: async Custom Hook to get Auth state from Backend/Online API. Topics on: Example FC. Read more: React, React API, Hooks API, Custom Hook

useCallback()

useCallback() is defined as: Memoizing Hook to Memoization Callback Function for given Deps Array. Topics on: extension of useMemo() equivalent to, !snippet use

useContext()

useContext() is defined as: Stateful Hook to subscribe to Context persist state in app-wide store in Parent Component. Topics on: . Read more: React, React API,

useEffect()

useEffect() is defined as: Hook to run Effect in FC at specific stage of Component Lifecycle, set by Deps Array. Topics on: Deps Array as 2nd Argument to useEff

useEventListener()

useEventListener() is defined as: Custom Hook to Refactor event listeners. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Use Event Listener,

useId()

useId() is defined as: Memoizing Hook to create stable UID DOM identifier BUT can clash with server-side instance. Topics on: for compat with non-human User Age

useLayoutEffect()

useLayoutEffect() is defined as: Hook variant of useEffect(), to call Effect as soon as DOM API generated BEFORE UI repaints to DOM API. Topics on: Displays

useLocalStorage()

useLocalStorage() is defined as: Custom Hook to. Topics on: . Read more: React, React API, Hooks API, Custom Hook|FullStack Wiki by Roger J

useMedia()

useMedia(). Topics on: . Read more: React, React API, Hooks API, Custom Hook, Use Media|FullStack Wiki by Roger J

useMemo()

useMemo() is defined as: Memoizing Hook to Memoization entire Component, some JSX or props, based on Deps Array change. Topics on: Memoization of Component, Mem

useOnClickOutside()

useOnClickOutside() is defined as: Custom Hook to detect click outside a specific element. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Use

useOnScreen()

useOnScreen() is defined as: Custom Hook to return boolean to check if node (as ref) is visible on Viewport; Abstraction Intersection Observer API Web API. Top

usePrevious()

usePrevious() is defined as: Custom Hook to get previous value of props or state. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Use Previous

useReducer()

useReducer() is defined as: Stateful Hook with logic to update new state from current state & payload via redux. Topics on: useReducer() for updating multiple p

useRef()

useRef() is defined as: Stateful Hook to persist Passive State Variable across renders in FC, as ref handle Escape Hatch to DOM API elements. Topics on: useRe

useRouter()

useRouter() is defined as: Custom Hook to combine useParams(), useLocation(), useHistory() & useRouteMatch(). Topics on: boilerplate snippet for custom useRoute

useScript()

useScript() is defined as: Custom Hook to Runtime load external Script. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Runtime, Script | Wiki

useState()

useState() is defined as: Stateful Hook to persist single state value in FC. Topics on: const [_value, _setter] = useState(initial), Lazy Initial value, !flow d

useState() vs CC

useState() vs CC. Topics on: CC can only have ONE state of Object type, CC always re-render if updated; even if nothing changed, CC has extends React.PureCompon

useToggle()

useToggle() is defined as: Custom Hook to flip boolean Parameter. Topics on: . Read more: React, React API, Hooks API, Custom Hook, Use Toggle, Boolean, Paramet

value

value is defined as: name for state being tracked. Topics on: when useState called, React checks if value & only re-render if value changes. Read more: React, R

why are hooks useful?

why are hooks useful?. Topics on: allows reuse of stateful logic between components w/o needing to change Component Hierarchy, allows splitting down component