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 had to figure this out today. Here's what I came up with:
// app.tsx near the rootimportZendesk,{ZendeskAPI}from"react-zendesk";<ZendeskdeferonLoaded={()=>{ZendeskAPI("webWidget","hide");}}zendeskKey={ZENDESK_KEY}/>
// shared-layout.tsx or single-one-off-page.tsximport{ZendeskAPI}from"react-zendesk";useEffect(()=>{ZendeskAPI("webWidget",showZendeskSupport ? "show" : "hide");},[]);
Mount <Zendesk /> near your app root. Optionally use onLoaded to hide the widget by default.
Use useEffect() to show/hide the widget on pages as needed.
Optionally if you have a layout component, you can add a prop (showZendeskSupport) to avoid duplicating the useEffect() everywhere.
Is is possible to render the contact form button conditionally?
The text was updated successfully, but these errors were encountered: