Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

useContext

function Main() {
  const value = 'My Context Value';
  return (
    <Context.Provider value={value}>
      <MyComponent />
    </Context.Provider>
  );
}
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #useContext
ADD COMMENT
Topic
Name
2+3 =