I have a problem with my React component. The nested children of my component ControlPanel
do not seem to be rendering. Here is my code:
class App extends Component {
render() {
return (
<div className="App">
<ControlPanel>
<CustomerDisplay />
</ControlPanel>
</div>
);
}
}
I have the following two lines at the top of this file:
import ControlPanel from './components/control_panel';
import CustomerDisplay from './components/customer_display';
And here is my ControlPanel
Component:
import React from 'react';
import CSSModules from 'react-css-modules';
import styles from './styles.scss';
const ControlPanel = () => {
return (
<div className="control_panel" id="control_panel">
</div>
);
}
export default CSSModules(ControlPanel, styles);
I tried:
- Calling a component as a full HTML tag (opening and closing)
- Embedding a component
CustomerDisplay
in a component ControlPanel
(in ControlPanel
index.jsx file )
I know that a nesting component is possible. I have seen that. For some reason this just won't work for me.
source
share