shouldComponentUpdate(next) returns whether to re-render — here: only when next.value differs from current. Input: a JSON array of incoming prop values over time (first is the mount value). Print the number of renders (mount included).
Input: one JSON array. Output: render count.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,1,2,2,3]
Output: 3
Hints
shouldComponentUpdate(next) returns whether to re-render — here: only when next.value differs from current. Input: a JSON array of incoming prop values over time (first is the mount value). Print the number of renders (mount included).
Input: one JSON array. Output: render count.
Your program reads from stdin and prints to stdout.
Example 1
Input: [1,1,2,2,3]
Output: 3
Hints