Why won't my nested React components render?

后端 未结 5 596
花落未央
花落未央 2020-12-15 17:44

I\'m having a problem with my React component. The nested children of my component ControlPanel don\'t seem to be rendering. Here is my code:

cl         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 18:36

    Your App.js (I understand that it is your JSX Index) should be:

    import React from 'react';
    import ReactDOM from 'react-dom';
    
    export default class App extends Component {
    render() {
    return (
      
    ); } } ReactDOM.render(, document.getElementById('YOUR_ROOT_ID'));

    Try to add export default before class (in all your components).

提交回复
热议问题