Answer the question
In order to leave comments, you need to log in
Is it possible to combine regular functions with an ES6 class in React?
First question:
In React, functions are written like this:
showName: function () {
}
function showName () {
}
showName: function () {
}
class Name extends Component {
}
var Name=React.createClass {
}
class Name extends Component {
showName: function () {
//....
}
}
Answer the question
In order to leave comments, you need to log in
learn.javascript.ru Learn everything
if possible. It's too early for you to take on React yet. All your questions are based on ignorance of JavaScript.
If it's a component then write like this
function SomethingComponent () {
}
showName () {
}
1) In the if statement, you are trying to ASSIGN A VALUE, NOT COMPARE
2) You need to call the properties of the element through GetComputedStyle or through style
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question