I have the following list that I'm trying to return a new List from, but I keep getting the error shown below. Any thoughts?
export const questions = List([
{uuid: uuid(), order: 0, text: 'Which country do you live in?', choices: [
{ choice: 'United States', added: true },
{ choice: 'Canada', added: true },
{ choice: 'Australia', added: true }
]},
{uuid: uuid(), order: 1, text: 'Which country were you born in?', choices: [
{ choice: 'Mexico', added: true },
{ choice: 'California', added: true },
{ choice: 'Seoul', added: true }
]}
]);
questions.setIn([0, 'text'], 'changed')
Results in this error:
immutable.js:870 Uncaught Error: invalid keyPath
at invariant (immutable.js:870)
at updateInDeepMap (immutable.js:1974)
at updateInDeepMap (immutable.js:1980)
at List.Map.updateIn (immutable.js:1278)
at List.Map.setIn (immutable.js:1256)
at eval (eval at ./src/reducers/questionsList.js (questionsList.js:17), <anonymous>:1:11)