Not being rendered properly
-
this text is not being rendered properly in Quick Answers section
Hi all,
i'm doing my first steps in react.
this code should write "On" but i get "App.js: Unexpected token, expected ( "
what am i missing?import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';class Light extends React.Component {
constructor(props) { super(props); this.state = {light:"On"}; }; function formatLightState() { return <h1>{this.state.light}</h1> ; } render() { return ( <div> {this.formatLightState()} </div> ); }
}
class App extends React.Component {
constructor(props) {
super(props);
}renderLight(){
return <Light />
}render() {
return (
<div>
{this.renderLight()}
</div>
);
}}
export default App;
this is the link that was giving me hard time Problem creating the simplest react progrem[^]
I do not fear of failure. I fear of giving up out of frustration.
-
this text is not being rendered properly in Quick Answers section
Hi all,
i'm doing my first steps in react.
this code should write "On" but i get "App.js: Unexpected token, expected ( "
what am i missing?import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';class Light extends React.Component {
constructor(props) { super(props); this.state = {light:"On"}; }; function formatLightState() { return <h1>{this.state.light}</h1> ; } render() { return ( <div> {this.formatLightState()} </div> ); }
}
class App extends React.Component {
constructor(props) {
super(props);
}renderLight(){
return <Light />
}render() {
return (
<div>
{this.renderLight()}
</div>
);
}}
export default App;
this is the link that was giving me hard time Problem creating the simplest react progrem[^]
I do not fear of failure. I fear of giving up out of frustration.
Fixed.
cheers Chris Maunder