Constructor
new Counters(props)
Class components always need to call the base constructor with props.
Moreover, ES6 classes need to call super in case they are subclasses.
Thus, if you wish to use it in the constructor, you need to pass it to super().
In case we omit it, we can always find props available inside render function.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | component input.
Properties
|
- Source:
- See:
Extends
- React.Component
Methods
render() → {HTMLDivElement}
Using a special prop called children to pass something between the opening and closing tag of an element. Counter could be self closed, but here we pass an <h6> tag.
This is useful when using dialog boxes to allow the consumer of that component to pass content to be rendered on the dialog box.- Source:
Returns:
a reset button plus a number of Counter components.
- Type
- HTMLDivElement