You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
247 B

2 years ago
  1. /**
  2. * 1.调用 createContext 方法
  3. * 2.通过顶层组件包裹 Context.Provider
  4. * 3.底层组件 useContext (createContext 返回的对象)
  5. */
  6. import { createContext } from "react"
  7. const Context = createContext()
  8. export default Context