Import not working
"use client"
import { useEffect } from 'react'
import { useRouter } from 'next/navigation'
import { InstantRedirect } from "@/utils/redirect.js"
export default function Home() {
const router = useRouter()
useEffect(() => {
InstantRedirect(router)
}, [router])
return null
}
"use client";
export function setupRedirectOnClick(router, buttonIds) {
buttonIds.forEach(id => {
const button = document.getElementById(id);
if (button) {
button.addEventListener("click", () => {
const path = button.getAttribute("data-path");
if (path) {
router.replace(path)
};
});
};
});
}
export function InstantRedirect(router) {
router.replace("/home")
};
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@components/": ["./src/components/"],
"@styles/": ["./styles/"],
"@utils/": [".src/utils/"]
}
}
}
import { useEffect } from 'react'
import { useRouter } from 'next/navigation'
import { InstantRedirect } from "@/utils/redirect.js"
export default function Home() {
const router = useRouter()
useEffect(() => {
InstantRedirect(router)
}, [router])
return null
}
"use client";
export function setupRedirectOnClick(router, buttonIds) {
buttonIds.forEach(id => {
const button = document.getElementById(id);
if (button) {
button.addEventListener("click", () => {
const path = button.getAttribute("data-path");
if (path) {
router.replace(path)
};
});
};
});
}
export function InstantRedirect(router) {
router.replace("/home")
};
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@components/": ["./src/components/"],
"@styles/": ["./styles/"],
"@utils/": [".src/utils/"]
}
}
}

