Popup Swap

Embedding on React.js

If you need to include the HiSwap script in React.js, you can dynamically add it using the following hook.

Make sure to create the HiSwap embed code first and copy the url. Replace {url} in the example with your custom URL.

import {useEffect} from 'react'
const useHiswap = () => {
        const a = document.createElement('script');
        a.type = 'module';
        a.async = true;
        a.setAttribute('hiswap', true);
        a.src = '{url}';
    }, [])