Console logging for react?

后端 未结 3 1826
面向向阳花
面向向阳花 2021-01-29 23:31

I\'m super new to React and I\'m trying to get it set up for Meteor and piecing stuff together from other sources too. One of these other sources set up console logging for the

3条回答
  •  爱一瞬间的悲伤
    2021-01-29 23:49

    If you're just after console logging here's what I'd do:

    export default class App extends Component {
      componentDidMount() {
        console.log('I was triggered during componentDidMount')
      }
    
      render() {
        console.log('I was triggered during render')
        return ( 
          
    I am the App component
    ) } }

    Shouldn't be any need for those packages just to do console logging.

提交回复
热议问题