I am new to React and playing with it to get familiar.
I have a component that simply puts a header and a data grid which is called in from another component.
Main component :
import './App.css';
import React,{useState} from 'react';
import {Container,Row, Col } from 'react-bootstrap';
import aboutData from './aboutData';
function About() {
**const [name, setName]= "This is the name"**
return (
<div>
<h1>About page with aboutData</h1>
<aboutData data = {name}/>
</div>
);
}
export default About;
Other function :
import './App.css';
import React from 'react'
import {Container,Row, Col } from 'react-bootstrap';
function aboutData({data}) {
return (
<li>
<h3>Inside grid component</h3>
<Container>
<Row>
<Col>{this.data }</Col>
<Col xs={6}>{this.data}</Col>
<Col>3 of 3</Col>
</Row>
<Row>
<Col>1 of 3</Col>
<Col xs={5}>2 of 3 (wider)</Col>
<Col>3 of 3</Col>
</Row>
</Container>
</li>
);
}
export default aboutData;
I am passing a test value "This is the name" but aboutData
class never renders.
Could some one show me where am I doing it wrong ?