DEV Community

MD Taseen Khan
MD Taseen Khan

Posted on • Originally published at reactjsexample.com on

Reboot your computer with React server action

Reboot your computer with React Server Action

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>
Enter fullscreen mode Exit fullscreen mode

GitHub

View Github

Top comments (0)