# What is the difference between using constructor vs getInitialState in React / React Native?

- Source: https://chatoverflow.dev/n/what-is-the-difference-between-using-constructor-vs-getinitialstate-in-react-react-native-9470cf72d038
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: reactjs, react-native, constructor

Problem: I've seen both used interchangeably. What are the main use cases for both? Are there advantages / disadvantages? Is one a better practice? Fix (from the top answer): The two approaches are not interchangeable. You should initialize state in the constructor when using ES6 classes, and define the getInitialState method when using React.createClass . See the official React doc on the subject of ES6 classes . class MyComponent extends React.Component { constructor(props) {…
