react根组件引用子组件问题

<*** />is using incorrect casing. Use PascalCase for React components,

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import toDoApp from './components/todoApp'

class App extends Component {
  render() {
    return (
      
logo
); } } export default App;

 

上面是源代码。没看出有什么问题。后来不断测试。发现引入组件标签第一位一定要大写

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import ToDoApp from './components/todoApp'

class App extends Component {
  render() {
    return (
      
logo <ToDoApp />
); } } export default App;

你可能感兴趣的:(react)