Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
How to set array in redux toolkit?

I dont know how to change Starter or any kind of key's value in the player? If the player is not a array i know how to do,but i have no idea about how to set array's value.(I guess this may use filter but i don't know actually how to do)

const playerSlice = createSlice({
    name: "player",
    initialState:{
        player:[
         {
           Name: 'cc',
           Starter:true,
           key:'1',
         },
        ]
   },
 
    reducers: {
        setPlayer:(state,action){
        //how to set Starter?
        }
    }

});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you want to set the starter-property of the first player in the array, you can access that at index 0.

state.player[0].Starter = false
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!