What does the … do in this React (using JSX) code and what is it called?
ES2018 (spread for arrays/iterables was a long time support for transpilation (as JSX spread attributes) in React projects, even if you could do so elsewhere, but not just attributes), …this.props spreads the \”own\” enumeable properties in props as discrete properties on the Modal element you\’re creating (e.g.: 1 and b: 2 . , so that \’\’s, for example, to .\”\n\nIs this the same as Modal a=this.props.a b=. This is.b title=\’Modalse> animation=?\n\nBut it\’s dynamic, so whatever \”own\” properties are in props. If children are an \’own\’ property, spread will include it.\’ If this is a child element, they will be passed on to Modal if putting child elements between the opening tag and closing tags are syntactic sugar – the good kind – for introducing the child property in the open tag.\n\nReact.Component render() () = = this.propst, child = This.D className,/; thisd classClassName>>spanto-backback_classclassinpoa(-sancdd-totomthjajad/Sandrondro.temtem?\n\n\n\nSpread notation is useful not only for that use case, but also for making a new object with most (or all) of the properties of an existing object — this.setState => …prevTtate.foo, : \”updated\”; (); it\’s very important when you\’re updating state, as you can\’t directly change state state: this SETSETSTATE: .statestate.\n\nParaphrase: That replaces this.state.foo with a new object with all the properties of this object as foo except the property, which becomes \”updated\”: This is the same object that is used to replace this with the original object.\n\nA: const obj = foo: 1, b: 2, c: 3, d: ; \’\’console.log(\’original\”) : // // creates a new object with i.e., \”updated\” .foo (…obej.pook) – okj, s-onon-backback-wrapper – height: 100% !