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

113
Views
React Redux arrow function not compiling

I created new React&Redux project with npx create-react-app my-app --template redux.

From below code i getting following Error: Parsing error: Invalid parenthesized assignment pattern.

After switching arrow function to expression everything works fine.

import { createSlice } from '@reduxjs/toolkit';

export const movieSlice = createSlice({
  name: "movie",
  initialState: { value: { title: "", descripion: "" } },
  reducers: {
    getMovies: (state, action) = () => {
      state.value = action.payload;
    }
  }
});

export default movieSlice.reducer;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you have added and extra () = by mistake i guess. Here is the solution

import { createSlice } from '@reduxjs/toolkit';

export const movieSlice = createSlice({
  name: "movie",
  initialState: { value: { title: "", descripion: "" } },
  reducers: {
    getMovies: (state, action) => {
      state.value = action.payload;
    }
  }
});

export default movieSlice.reducer;
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!