Help with state management
Unanswered
Common Black-Hawk posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Common Black-HawkOP
So I want to be able to access the state of a component (filename = langselector.jsx. I want to know the language selected in every part of the project) so I asked chatgpt and he told me to this
First image is src/app/components/context.jsx
Second image is src/app/components/langselector.jsx
Third image is src/app/layout.js
Fourth image is where I want to access it.
It outputs an error saying useLanguage is not a function, i bet this has something to do with the 'use client' stuff, I really dont get whats the point of it, other next.js versions didnt have that
First image is src/app/components/context.jsx
Second image is src/app/components/langselector.jsx
Third image is src/app/layout.js
Fourth image is where I want to access it.
It outputs an error saying useLanguage is not a function, i bet this has something to do with the 'use client' stuff, I really dont get whats the point of it, other next.js versions didnt have that
![Image](https://cdn.discordapp.com/attachments/1170469257310642176/1170469257583276103/Captura_de_pantalla_2023-11-04_a_las_3.00.19_p.m..png?ex=65592771&is=6546b271&hm=0390c9e366caecbfa9ba41cc2744fecca91973b7337ba49dc7d7c50ab19c618e&)
![Image](https://cdn.discordapp.com/attachments/1170469257310642176/1170469257960771724/Captura_de_pantalla_2023-11-04_a_las_3.01.07_p.m..png?ex=65592771&is=6546b271&hm=6fc257ec1f0b8daf15f6ac8d72001b5c9e56b8f6dc7655289387d58945c73003&)
![Image](https://cdn.discordapp.com/attachments/1170469257310642176/1170469258325663835/Captura_de_pantalla_2023-11-04_a_las_3.01.59_p.m..png?ex=65592771&is=6546b271&hm=75bd5d5926eea24dba5b21207339e2f5bbb8a34b26c21816dc0de19f6f83db19&)
![Image](https://cdn.discordapp.com/attachments/1170469257310642176/1170469258619269230/Captura_de_pantalla_2023-11-04_a_las_3.06.06_p.m..png?ex=65592771&is=6546b271&hm=d5afd041af02c8dd8f7c61915dd974b2a850e2f9f0b7b3f732e9aa59b2a28598&)