Nolra / front_course_2023

charity course
7 stars 0 forks source link

React Context #21

Open Nolra opened 1 year ago

Nolra commented 1 year ago

CODE: https://github.com/Nolra/front_course_2023/tree/react-context

Документация по теме: https://react.dev/reference/react/useContext

HW: (https://nolra.github.io/react_hw/ - вкладка Reducer & Context) Реализуйте компонент смены темы (как в образце) действие которого будет распространятся на компонент todo app и сам компонент смены темы theme switcher.

voidaugust commented 1 year ago

https://pashbespaloff.github.io/react-craftworks/ https://github.com/pashbespaloff/react-craftworks

Я сделал тут чуть иначе, у меня контекст (фон) меняется у одного из корневых компонентов. Объявляю стейт для фона в App, использую его во Wrapper, а меняю в ContextBackgroundSwitch.

nedostatoksna commented 11 months ago

https://nedostatoksna.github.io/react_homeworks/ https://github.com/nedostatoksna/react_homeworks/tree/main/src/components/ReducerAndContext