December 2024
useActiveFile() Hook
The useActiveFile() hook returns the file actively focused on by the current user.
Usage
Copy
Ask AI
import { useActiveFile } from "@replit/extensions-react";
const Component = () => {
const activeFile = useActiveFile();
return (
<>
<span>Active File: {activeFile}</span>
</>
);
};
Signature
Copy
Ask AI
function useActiveFile(): string | null;
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.