import { useParams } from "react-router-dom";
`const CoinPage = () => { const {id} = useParams([]); const [coin, setCoin] = useState();
const { currency, symbol } = CryptoState();
const fetchCoin = async () => { const { data } = await axios.get(SingleCoin(id));
setCoin(data);
};
useEffect(() => { fetchCoin();
}, []);`
my api:
export const SingleCoin = (id) => https://api.coingecko.com/api/v3/coins/${id};
all other coins without hyphen work fine, apart from those with hyphens. Am totally knew and confused