How to dispatch value with join function in redux (react-native)

Viewed 47

I am having a state in redux store, I want to use function join() to join another value while dispatch but while using join() I get error join() is not a function.

var id = ['3','5']
dispatch({
 type: UPDATE,
 payload:{
  name: id.join();//this doesn't work
 }
})
1 Answers

It should work. But I see a typo

var id = ['3','5']
dispatch({
 type: UPDATE,
 payload:{
  name: id.join(),
 },
})
Related