The useActiveFile() hook returns the file actively focused on by the current user.
import { useActiveFile } from "@replit/extensions-react"; const Component = () => { const activeFile = useActiveFile(); return ( <> <span>Active File: {activeFile}</span> </> ); };
function useActiveFile(): string | null;
Was this page helpful?