I'm completely new React. I have done the tutorials but as always reading and doing are two seperate things. So starting a brand new app from scratch and have fallen at the first hurdle.
I have a component called AnswerBox and a component called GetAnswerButton but the html in GetAnswerButton is not being rendered so I assume its not being passed to the AnswerBox component. Only the AnswerBox html is being rendered. So question, could anyone please point out the error of my ways
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
class AnswerBox extends React.Component{
render(){
return(
<GetAnswerButton />,
<div className="answerBox"></div>
)
}
}
class GetAnswerButton extends React.Component {
render() {
return (
<div>
<button>Click Me</button>
</div>
)
}
}
ReactDOM.render(
<AnswerBox />,
document.getElementById('root')
);
Heres a code pen of it working(or not working!!) Codepen