Open this example in the interactive library
Source code
"use client";
// app/studio/template.tsx
import { useState } from "react";
import type { ReactNode } from "react";
export default function RemountingWelcomeTip({ children }: { children: ReactNode }) {
const [shown, set] = useState(true);
return (
<>
{shown && (
<aside>
Use the chapter links to explore.{" "}
<button onClick={() => set(false)}>Dismiss</button>
</aside>
)}
{children}
</>
);
}
