0

I see something like then following.

render() {
  <Foo {...this.props} />
}

I know what it does but can someone confirm that this is actually not the spread syntax used in ES2015 (or indeed the proposed object spread syntax) and that it is instead a JSX-specific syntax that looks like the ES spread syntax?

Here the curly braces are JSX delimiters for a JavaScript expression and ...this.props is not a valid standalone expression in normal JavaScript.

Ben Aston
  • 49,455
  • 61
  • 188
  • 322
  • JSX itself is not a valid standalone expression.So I guess yes, its a JSX specific syntax – Rajesh Aug 17 '17 at 13:27
  • 1
    It's not ES spread, it's JSX spread. All of your JSX is getting transpiled to JS/ES. – ivarni Aug 17 '17 at 13:27
  • This might help: https://stackoverflow.com/questions/32363911/trouble-understanding-jsx-spread-operator – Rajesh Aug 17 '17 at 13:28

0 Answers0