tinky / useApp
useApp():
AppProps
useApp is a React hook that exposes a method to manually exit the app
(unmount).
The app context containing the exit function.
import { render, useApp, useInput } from "tinky";
const Component = () => {
const { exit } = useApp();
useInput((input) => {
if (input === "q") {
exit();
}
});
return null;
};
render(<Component />);