🌍 Public
Viewing a saved revision (read-only)
b64efdf6271341a7af0cdddabf4a2ff6
Javascript inside html
This example demonstrates how JavaScript expressions can be embedded directly within JSX markup in a React application, rendering both text calculations and SVG circles. The code uses React 16.10.0 with ReactDOM to mount a component that computes squares of array values and maps them to `<circle>` elements with magenta and green fills. It also maps string elements to list items in a separate `Test` component. The visualization shows a simple SVG scene with positioned circles on a 960×500 canvas, highlighting the interplay between inline JavaScript logic and declarative React rendering.
AI-generated descriptionReact Starter code.