0
It is bad practice to call functions and/or add structures (conditional, interaction) within the component render method before Return, for example:
export default class Header extends Component {
funcao() {
...
}
render() {
this.funcao();
return (
...
)
}
}
What does this function do? I think it’s okay...
– Luiz Felipe
The way you exemplified has no validity, is not correct and why only at the time of rendering? you need to create a more real minimum example, what the function will do? maybe there are better methods to solve this and better times. Finally say what you will do, if it is generic your question can even be closed, so always focus on the problem
– novic