Don't use constructor

to don something
don synonym
don urban dictionary
don medical abbreviation
don meaning slang
don meaning italian
don japanese

In my code, I did not use constructor (). I've always seen people use the constructor in class components, but even though I'm not using it in that code, it's working perfectly. In my code, putting the state outside the constructor, is it a good idea or would it be better to use the constructor with the state set inside it? Can it give some sort of error in the future, or worsen my system's performance doing so? What is more advisable to do in this case?

import React, { Component, Fragment } from 'react'
import  {Redirect} from 'react-router-dom'
import { connect } from 'react-redux'

import ActionCreator from '../redux/actionCreators'

import Button from '../elements/Button'

const statsgenre = {
'Ação': 'Action',
'Comédia': 'Comedy',
'Drama': 'Drama'

const statsuser = {
'Assistido' : 'Watched',
'Assistindo': 'Watching',
'Assistir': 'Watch' 

class ScreensEditSeries extends Component{

state = {
    id: '',
    name: '',
    status: '',
    genre: '',
    notes: ''

componentDidMount = () => {    
    const serie  = {...this.props.match.params}

static getDerivedStateFromProps(newProps, prevState){
    let serie = {}
    if ( === '' || === undefined){  
        if ( !=={

        if (newProps.series.serie.genre !== prevState.genre){
            serie.genre = newProps.series.serie.genre

        if (newProps.series.serie.status !== prevState.status){
            serie.status = newProps.series.serie.status
        if (newProps.series.serie.notes !== prevState.notes){
            serie.notes = newProps.series.serie.notes
        return serie

saveSeries = () => {
    const {name, status, genre, notes} = this.state
    const id =
    const newSerie = {

handleChange = field => event => {
    this.setState({[field] :})

    return (
            <div className="container">         
                    {this.props.series.saved  && <Redirect to={`/series/${this.props.match.params.genre}`}/>}
                    <h1 className='text-white'>Edit Série</h1>
                    {!this.props.series.isLoadding && <Button>
                        Name: <input type="text" value={} onChange={this.handleChange('name')} className="form-control" /><br />
                        Status: {<span>&nbsp;</span>} 
                        <select value={this.state.status} onChange={this.handleChange('status')}>
                                .map( key => <option key={key}>{statsuser[key]}</option>)}
                        Genre: {<span>&nbsp;</span>} 
                        <select value={this.state.genre} onChange={this.handleChange('genre')}>
                                .map(key => <option key={key}>{statsgenre[key]}</option>)}
                        Notes: <textarea type='text' value={this.state.notes} onChange={this.handleChange('notes')} className="form-control"></textarea><br />
                        <button className="button button2" type="button" onClick={this.saveSeries}>Save</button>
                    {this.props.series.isLoadding && <p className='text-info'>Loading...</p>}

const mapStateToProps = state => {
return {
    series: state.series

const mapDispatchToProps = dispatch => {
return {
    load : serie => dispatch(ActionCreator.getSerieRequest(serie)),
    save: newSerie => dispatch(ActionCreator.updateSerieRequest(newSerie)),
    reset : () => dispatch(ActionCreator.seriesReset()),


export default connect(mapStateToProps, mapDispatchToProps)(ScreensEditSeries) 

In general, you should only use a constructor if you need logic when the class is first created, or if your setup depends on the props passed in. Since everything in your initial state is hardcoded not using a constructor is fine in this case.

don, /Doña - A courtesy title placed before the 1st name of an older or more senior man/woman as a way of showing them your respect when talking to them or about them. Although now becoming rarer, they are commonly used before full names on official documents and contracts. 1. Don (also dōn) Used as a courtesy title before the name of a man in a Spanish-speaking area. 2.

There is no problem in using class components without a constructor. Usually you need it in case you have to do some work to prepare the state, process some props or other setup some instance variables as soon as the component is instantiated.

It's ok :)

Here, instead, there is a very interesting post from Dan Abramov about why, if you need to use the constructor, is needed to call super(props):

Not super related to the question, but asking about constructor, I thought it could be useful to you.

What does the word "Don" mean to a Spanish or English speaker , Definition of don. (Entry 1 of 4) transitive verb. 1 : to put on (an article of clothing) donned his hat and gloves. 2 : to wrap oneself in : take on sense 3a the donning of new and more tyrannous moralities— Edward Sapir. Don definition, Mr.; Sir: a Spanish title prefixed to a man's given name. See more.

There's no difference. The reason you see most people doing it inside of the constructor is because doing state = {} directly on the class is new syntax that hasn't been widely adopted yet (it often still requires a Babel or similar transformation). See proposal-class-fields for more information on it. One thing to note is that if you need to access any props to initialize the state, you have to do that in the constructor.

DON, Don definition, Mr.; Sir: a Spanish title prefixed to a man's given name. See more. Don, and dom, is derived from the Latin Dominus: a master of a household, a title with background from the Roman Republic in classical antiquity.

Don, A don is a guy that everyone wants to be like. He is not only sexy and muscular but amazing in bed aswell. He can rock anyone. Being a don is a talent that not  Dôn, in Celtic mythology, leader of one of two warring families of gods; according to one interpretation, the Children of Dôn were the powers of light, constantly in conflict with the Children of Llyr, the powers of darkness. In another view, the conflict was a struggle between indigenous gods and those of an invading people.

Don, VerbEdit. don (third-person singular simple present dons, present participle donning, simple past and past participle donned). (  Edward Don and Company is the world's leading distributor of foodservice equipment and supplies. Online ordering

Don, To don means to put on, as in clothing or hats. A hunter will don his camouflage clothes when he goes hunting. A don is a guy that everyone wants to be like. He is not only sexy and muscular but amazing in bed aswell. He can rock anyone. Being a don is a talent that not everyone can achieve.