[Solved] In React with ES6 , constructor(prop) doesn’t raise error. Why?


A constructor is a javascript function. The arguments that it takes are positional arguments. That means the values are determined by their position in the argument list and not by their name. Javascript doesn’t have named parameters.

The first parameter of the constructor of React.Component is containing the props that where passed to it on creation (The second one is the context). It doesn’t matter which name you use for the parameter inside your implementation of it.

solved In React with ES6 , constructor(prop) doesn’t raise error. Why?