Problems

Lifecycle Call Order

EasyComponent Lifecycle

Print the classic lifecycle for a sequence. Input: a JSON array of phases from mount, update, unmount. mount → constructor, render, componentDidMount; update → render, componentDidUpdate; unmount → componentWillUnmount. One method per line.

Input: one JSON array. Output: method names in order.

Your program reads from stdin and prints to stdout.

Example 1

Input: ["mount","update","unmount"]

Output: constructor render componentDidMount render componentDidUpdate componentWillUnmount

Hints

ReactLifecycle