I am unable to use image as background Image in react javascript

import { useState } from 'react'
import img from './Images/bg.jpg';
export default function Home() {
  const[BackPhoto] = useState(img);
  return (
<>
<section
        style={{ backgroundImage : BackPhoto}}
      >
</section>
</>

I am a beginner and learning react js . I am making a website and I have been stuck. I want to import a image and use it as a background photo by turning it in a state.. Please solve my problem.