Reboot your computer with React Server Action
example.mp4
Steps:
- corepack enable
- pnpm install
- pnpm dev
- click the
Reboot
button on the browser
Code snippets
import { reboot } from '@napi-rs/system-shutdown'
<form
action={async () => {
'use server'
reboot()
}}
>
<Button
>
</svg>
Reboot
</Button>
</form>