Install guides (31)
Add Ishara to React Router and Remix
Add the feedback widget to a React Router or Remix app with one script tag in the Layout export of app/root.tsx, so it’s on every route.
- Where it goes
- The
Layoutexport inapp/root.tsx - Allowed domains
- Your own domain (set when you add the site)
- Time
- About 3 minutes
Steps
In Ishara, open Sites → your site → Install and copy the line under Add the line to your site. Your site’s key is already in it:
<script src="https://useishara.com/w.js" data-site="pk_…" defer></script>
In
app/root.tsx, paste the line inside<body>in theLayoutexport, next to<Scripts />(add the export as below if your file doesn’t have one). JSX takes the tag as it is:import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router"; export function Layout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <head> <meta charSet="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <Meta /> <Links /> </head> <body> {children} <script src="https://useishara.com/w.js" data-site="pk_…" defer></script> <Scripts /> <ScrollRestoration /> </body> </html> ); } export default function App() { return <Outlet />; }Build and deploy the app.
Open your site. Back on the Install page, Check it’s live turns into The widget is live as soon as the widget loads. Then open the Reviewer link from the same page: only people who open it see Leave a note.
Good to know
Layoutalso wraps the error boundary and the hydration fallback, so the widget loads on every route, error pages included.- React Router’s docs now cover version 8; the
root.tsxandLayoutconventions are the same as in version 7. - If you use a nonce-based Content Security Policy, give the tag the same
nonceyou pass to<Scripts />.
Next
Once reviewers leave notes, your coding agent can apply them. The widget’s options (language, position, colour, launcher) are in the docs.