Problems

Lift State Up

EasyReact Best Practices

Two sibling inputs must stay in sync — so state lives in the parent. Input: events left V or right V (one per line) each setting the shared value. Print the value BOTH siblings display after all events, as left=V right=V.

Input: event lines. Output: one line: left=V right=V.

Your program reads from stdin and prints to stdout.

Example 1

Input: left 5 right 9

Output: left=9 right=9

Hints

ReactStateArchitecture