Using Constructor:
import { Text } from 'react-native';
import Component from 'react';
class Blink extends Component {
constructor(props) {
super(props);
this.state = {test: "Hello"};
}
Without constructor:
import { Text } from 'react-native';
import Component from 'react';
class Blink extends Component {
state = { test:"Hello" }
}
The code works in the same way. But what's the difference? Which one is better?