Answers for "text color in react js"

0

text color in react js

import React from 'react';

export const UserContext = React.createContext();

export default function App() {
  return (
    <UserContext.Provider value="Reed">
      <User />
    </UserContext.Provider>
  )
}

function User() {
  return (
    <UserContext.Consumer>
      {value => <h1>{value}</h1>} 
      {/* prints: Reed */}
    </UserContext.Consumer>
  )
}
Posted by: Guest on August-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language