Devjar

live code runtime for your react project in browser


index.js
./mod1.js
./styles.css
+

  import { useState } from 'react'
  import useSWR from 'swr'
  import Text from './mod1'
  import './styles.css'

  export default function App() {
    const [num, inc] = useState(1)
    const { data } = useSWR('world', key => key)
    return (
      <div>
        <h2 class="text-3xl">
          hello <Text /> <span class="font-bold underline">{data}</span>
        </h2>

        <p>Volume {Array(num % 6).fill('').join('')}</p>
        <button className='button' onClick={() => inc(num + 1)}>increase</button>
      </div>
    )
  }