You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use Features Nav in my Remix App, and for that I tried to follow this Installation Steps but unfortunately I was failed to use it.
I am able to render the UI exactly as it's Tailwind CSS, but the functionality, I am not able to make it, can anyone help me where I am doing the mistake?
The text was updated successfully, but these errors were encountered:
Create preline.client.tsx file for example in ~/components folder. (We will use client module):
import{useLocation,}from"@remix-run/react";import{useEffect}from"react";import{IStaticMethods}from"preline/preline";declare global {interfaceWindow{HSStaticMethods: IStaticMethods;}}exportdefaultfunctionPrelineScript(){constlocation=useLocation();useEffect(()=>{import("preline/preline");},[]);useEffect(()=>{setTimeout(()=>{window.HSStaticMethods.autoInit();},100);},[location.pathname]);returnnull;}
Connect this file in root.tsx:
...
// Import at top of fileimportPrelineScriptfrom"~/components/preline.client";exportfunctionLayout({ children }: {children: React.ReactNode}){return(<htmllang="en"><head><metacharSet="utf-8"/><metaname="viewport"content="width=device-width, initial-scale=1"/>
<Meta/><Links/></head><body>{children}<ScrollRestoration/><Scripts/>{/* Add preline script on every page */}{PrelineScript&&<PrelineScript/>}</body></html>);}
...
Replace typeof window !== "undefined" with typeof document !== "undefined" to handle runtimes outside of Node like Deno. Read the Remix Gotchas for more info.
Hello,
I wanted to use Features Nav in my Remix App, and for that I tried to follow this Installation Steps but unfortunately I was failed to use it.
I am able to render the UI exactly as it's Tailwind CSS, but the functionality, I am not able to make it, can anyone help me where I am doing the mistake?
The text was updated successfully, but these errors were encountered: