833 B
833 B
title
| title |
|---|
| Use the Lifecycle Method componentWillMount |
Use the Lifecycle Method componentWillMount
The challenge is a basic introduction to React's LifeCycle components. These methods are also called Lifecycle Hooks.
Hint 1
Log something to the console in the react componentWillMount method.
Hint 2
The console.log(); statement is used to log to the browser console.
Solution
Since you can log anything, use the console.log(); and pass in a string. The componentWillMount method should look like:
componentWillMount() {
console.log('Component being mounted');
}