Uncaught TypeError: Cannot assign to read only property 'background' of object '#<Object>'

my project is babel7.

render() {
  const {elementStyle, style } = this.props;
  return (
            <span style={Object.assign(elementStyle, style)}>{label} 
            </span>
        )
}

//Object.assign(elementStyle, style) --> error. but i correct Object.assign({}, elementStyle, style) is working. and why is not working?? i debuggered this code. at first is working but when reredering, this code is error... i don't know please help me.

#reactjs #webpack

4 Likes57.70 GEEK