samedi 27 juin 2020

toggling action in checkboxes in React-Redux doesn't work

Hello i have problem with my action in Redux. I want will check single checkbox and if it will be clicked, my state will change

FOR EXAMPLE: if i click on second element my value will change. Other elements will doesnt change
if i have state[0].question[0].answers[1].checked = true || false if i will click 2x in the same place

will be helpful:

state - I have state which is arr and have some objects inside (https://github.com/RetupK/QuizApp/blob/master/src/store/quiz/quizReducer.js)

actions creators - (https://github.com/RetupK/QuizApp/blob/master/src/actions/quiz/quizActions.js)

quizId - it depends on what we quiz we will choose. It is Routing match parametr. here is our routing (https://github.com/RetupK/QuizApp/blob/master/src/App.js)
here is our Component and showed how i did mapDispatchToProps and how i connected this with view (https://github.com/RetupK/QuizApp/blob/master/src/containers/quizContainer.js)

activeQuestion - it is which question is active this is local state in component.

Someone know how to resolve this problem with doesnt working this action?




Aucun commentaire:

Enregistrer un commentaire