next.js/test/integration/fallback-modules/fixtures/with-crypto/pages/index.js
index.js14 lines331 B
import { useEffect, useState } from 'react'
import seedrandom from 'seedrandom'

const rng = seedrandom('hello')

export default function () {
  const [value, setValue] = useState(null)
  useEffect(() => {
    if (value) return
    setValue(rng())
  }, [value])
  return <div>{value == null ? 'loading' : value.toString()}</div>
}
Quest for Codev2.0.0
/
SIGN IN