Skip to content

Tag: constructor

Different behavior when extend natives class with constructor and passing arguments to super

Different behavior calling a constructor and without calling it, when creating an instance of an inherited class: 1Case when I pass constructor: 2Case when it happens automatically There are different behavior Please tell me what is the difference, and why is this behavior observed? Answer In a subclass, the default constructor the JavaScript engine will supply if you don’t provide

How to in React Component constructor set this state

I still learn much React JavaScript and now I can’t understand how to create this initial state. In the constructor here in the code I want to add to state by running this line: And direct after I want to add more state variables like this: The problem now is that state does not contain the first call to CsvViewer.