AICurious Logo
Published on
Monday, April 1, 2019

ReactJS lifecycle method inside a functional Component

196 words1 min read
Authors
import React, { Component } from 'react'
import lifecycle from 'react-pure-lifecycle'

const methods = {
  componentDidMount(props) {
    console.log('I mounted! Here are my props: ', props)
  },
}

const Channels = (props) => <h1>Hello</h1>

export default lifecycle(methods)(Channels)

Source: StackOverFlow.