Add another example

This commit is contained in:
Steve Kinney
2024-10-01 19:36:39 -05:00
parent 867bc939ae
commit 5710f74461
5 changed files with 58 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
import { useState } from 'react';
export const AlertButton = ({}) => {
const [message, setMessage] = useState('Alert!');
return (
<div>
<label>
Message
<input
type="text"
value={message}
onChange={(event) => setMessage(event.target.value)}
/>
</label>
<button onClick={() => alert(message)}>Trigger Alert</button>
</div>
);
};