I want to use stop function in useSound Hooks in diffrent name because I alredy used stop variable.
import play from "./assets/play.mp3";
const [Phone,{stopPhone as stop }] = useSound(phone);
I want to use stop function in useSound Hooks in diffrent name because I alredy used stop variable.
import play from "./assets/play.mp3";
const [Phone,{stopPhone as stop }] = useSound(phone);
On
If useSound returns an array, there should be no need to "rename" any of its items - simply put in the names you want into the destructuring syntax:
const [Phone,stopPhone] = useSound(phone);
you can simply choose whatever names you wish.
If it returns an object you can use object destructuring as follows
const [Phone,{ stop: stopPhone }] = useSound(phone);
You should use Object desctructoring like so: