I am trying to write a function with properties but keep getting a syntex error.
I need to define my state but not sure where this should be placed. What is the best way to write the below code?
UPDATED--
class TEST extends React.Component {
constructor(props) {
super(props);
}
state = {isApp: false,}
myFunction = ({ isApp }) => {
return (
<div>
<p>Hello World</p>
</div>
)}
}
export default TEST;
I am guessing that my arrow function should not be within the class?
The syntax error has gone but now the page does not load at all, I guess it doesn't know what to do with "myFunction "
constin front of myFunction and you forgot the closing paren on thereturn. You have one too many closing curly braces