Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
State the difference between getInitialState() and constructor()?
Home
ReactJS
State the difference between getInitialState() and constructor()?
0
votes
asked
Dec 22, 2023
in
ReactJS
by
john ganales
State the difference between getInitialState() and constructor()?
constructor
getinitialstate
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Dec 22, 2023
by
john ganales
If you want to create one component by extending ‘React. Component’, the constructor helps you to initialize the State. But, if you want to create by using ‘Reat.createClass.’ then you should use ‘genInitiaState.’
Related questions
0
votes
Q: What is the key difference between a constructor and ngOnInit?
asked
Jun 6, 2022
in
Angular
by
john ganales
ngoninit
constructor
0
votes
Q: Explain the difference between constructor and setter injection?
asked
Apr 4, 2021
in
Spring
by
Robindeniel
spring-setter-injection
constructor
spring-configuration-file
configuration-file
spring
spring-questions
spring-java-framework
spring-interview-questions
spring-advanced-questions-2021
spring-questions-and-answers
spring-framework
0
votes
Q: What is the difference between constructor and getInitialState?
asked
Mar 1, 2020
in
ReactJS
by
RShastri
+1
vote
Q: What is a Constructor in Java?
asked
Feb 1, 2023
in
JAVA
by
sharadyadav1986
constructor
java
0
votes
Q: Which of the following cannot have a constructor
asked
Apr 21, 2022
in
Scala Constructs
by
sharadyadav1986
constructor
0
votes
Q: What will happen if "In a C++ program a class has no name"?
asked
Jan 24, 2021
in
JAVA
by
rajeshsharma
#c
-program
constructor
java
Java-questions-answers
0
votes
Q: State the main difference between Pros and State
asked
Dec 15, 2023
in
ReactJS
by
rahuljain1
pros
state
0
votes
Q: State the difference between Real DOM and Virtual DOM
asked
Dec 14, 2023
in
ReactJS
by
rahuljain1
dom
0
votes
Q: What is the difference between state and props in Reactjs?
asked
Oct 28, 2023
in
ReactJS
by
DavidAnderson
reactjs-interview-questions-answers
0
votes
Q: What is the difference between state and props?
asked
Mar 30, 2020
in
ReactJS
by
amita rallin
#react-state
#react-props
...