import { useState } from "react"; import { invoke } from "@tauri-apps/api/core"; export function Greet() { const [greeting, setGreeting] = useState(""); const [name, setName] = useState(""); async function greet() { // Learn more about Tauri commands at https://v2.tauri.app/develop/calling-rust/ setGreeting(await invoke("greet", { name })); } return (
{greeting}
)}