ReactJS lifecycle method inside a functional Component

Published on
209words
2 min read
ReactJS lifecycle method inside a functional Component
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.