Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 897 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 897 Bytes

React Context in WorkShop

L'objectif du projet est de découvrir la mise en place d'un context React avec la gestion des langues

Steps

  • 1/ Create and export context objects and provider components in contexts/LanguagesContext.js.
  • 2/ Set the state of the langages in the context provider.
  • 3/ Import the context on the App.jsx and encapsule all your routes within
  • 4/ Consume the data of the langages in the setting component, and update the context langage.
  • 5/ The language should have the currentLanguage ("en") selected by default (defaultValue) in the context.
  • 5/ Import now the context in the proverbs components.
  • 6/ Consume the langague provider langage in the fetch (changing the currentLanguage should trigger the ProverbsPage to load the proverbs for that language).
  • 7/ Make UI translations (on the titles and links, ...) work with the currentLanguage from Context.