Site icon Puneet Sharma – Freelance Web Developer

Codepen React Starter Template with Babel Transpiler

Here is a simple program coded using REACT features in Codepen with the help of external react libraries and Codepen’s Babel Transpiler.

HTML

JS (Babel)

import React, { useState, useRef, useEffect } from 'https://esm.sh/react@18.2.0'
import ReactDOM from 'https://esm.sh/react-dom@18.2.0'

const App = () => {
  const [count, setCount] = useState(0);
  
  return(
    <div className="box">
      <h1>Count: {count}</h1>
    </div>
  );
}

ReactDOM.render(<App/>, document.getElementById("root"))

DEMO

See the Pen React Starter Template with Babel Transpiler by Puneet Sharma (@webdevpuneet) on CodePen.

Exit mobile version