Open oyerohabib opened 4 years ago
App.js `import React, { Component } from 'react'; import Ninjas from './Ninjas';
class App extends Component { states ={ ninjas : [ { name:"oyero", age:20, belt:"Black", id: 1 }, { name:"habib", age:18, belt:"white", id: 2 }, { name:"ola", age:16, belt:"green", id: 3 } ] } render () { return(
Welcome!!!
)
} }
export default App; ` Ninjas.js 'import React, { Component } from 'react';
class Ninjas extends Component { render () { const { ninjas } = this.props; const ninjaList = ninjas.map(ninja => { return (
) }) return( <div className="ninja-list"> {ninjaList} </div> )
export default Ninjas '
App.js `import React, { Component } from 'react'; import Ninjas from './Ninjas';
class App extends Component { states ={ ninjas : [ { name:"oyero", age:20, belt:"Black", id: 1 }, { name:"habib", age:18, belt:"white", id: 2 }, { name:"ola", age:16, belt:"green", id: 3 } ] } render () { return(
My First React App
Welcome!!!
} }
export default App; ` Ninjas.js 'import React, { Component } from 'react';
class Ninjas extends Component { render () { const { ninjas } = this.props; const ninjaList = ninjas.map(ninja => { return (
} }
export default Ninjas
'