I have to print 10 elements in a column, like 1,2,3 ... with a timeout of 1 second. But in my code I don't know how to print message in a loop . I tried with innerHTML but I don't think it's a right way to do.

```
import { useState } from 'react'

export default function Timeout() {
  const [message, setMessage] = useState(1)

  while (message <= 10) {
    setTimeout(() => {
      setMessage(message)
    }, 1000)
    message++
  }

  return <div>{message}</div>
}

```