Skip to main content
100%

Javascript inside html

✓ Published1🌍 Public
CCurran Kelleher
Last edited Feb 21, 2020
Created on Feb 21, 2020

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 description

React Starter code.

MIT Licensed

Similar vizzes