Use Context

1. Use context

  • use context là để quản lý global state.

  • state thông thường --> props, action trực tiếp con

  • cháu, chắt ???

2. Các bước setup useContext

  • Define context

  • Data, Actions (Business) define bình thường.

  • Provider cháu, con thông qua context

  • Con, cháu : đọc data, actions

Last updated

Was this helpful?