Add another example
This commit is contained in:
20
examples/element-factory/src/alert-button.jsx
Normal file
20
examples/element-factory/src/alert-button.jsx
Normal 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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user