From f78953a66c1927f5a223b783fd26e91c5567ab2d Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Wed, 20 Nov 2024 19:21:10 +0700 Subject: [PATCH] Create Form.js --- .../src/components/UIComponents/Form.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dapps-builder/src/components/UIComponents/Form.js diff --git a/dapps-builder/src/components/UIComponents/Form.js b/dapps-builder/src/components/UIComponents/Form.js new file mode 100644 index 000000000..19ae49b1f --- /dev/null +++ b/dapps-builder/src/components/UIComponents/Form.js @@ -0,0 +1,25 @@ +import React, { useState } from 'react'; + +const Form = ({ onSubmit }) => { + const [input, setInput] = useState(''); + + const handleSubmit = (e) => { + e.preventDefault(); + onSubmit(input); + setInput(''); + }; + + return ( +
+ setInput(e.target.value)} + placeholder="Enter your input" + /> + +
+ ); +}; + +export default Form;