Problems

Class vs Functional Output

EasyReact Components

The same UI written two ways must render identically. Implement functional Badge(props) and class-style BadgeClass (with a render() method) that both return <span class="badge">TEXT</span>. Input: JSON {"text": string}. Print both outputs on two lines (they must match).

Input: one JSON props object. Output: two identical lines.

Your program reads from stdin and prints to stdout.

Example 1

Input: {"text":"new"}

Output: <span class="badge">new</span> <span class="badge">new</span>

Hints

ReactComponentsClasses
Class vs Functional Output | CodeForge AI