State

Added in React 16.8
Hooks let you use state and other React features without writing a class.
Functions starting with "use" are called Hooks.


Only call Hooks from React function components. Don't call Hooks from regular JavaScript functions
Only call Hooks at the top level. Don't call Hooks inside loops, conditions, or nested functions.




useContext

Accepts a context object (the value returned from React.createContext) and returns the current context value for that context.

const value = useContext(MyContext); 


@fluentui/react-hooks

Helpful hooks not provided by React itself.
These hooks were built for use in Fluent UI React





© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext