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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post