Validation with multiple base classes done
This commit is contained in:
parent
799f044aaf
commit
ddb648dcbf
8 changed files with 28 additions and 21 deletions
|
|
@ -1,11 +1,16 @@
|
|||
export default function Input({onChange}){
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Input({value, onChange}){
|
||||
const [myValue, setMyValue] = useState(value ?? "");
|
||||
return (
|
||||
<>
|
||||
<input
|
||||
type="text"
|
||||
value={myValue}
|
||||
className="block w-full form-input rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
placeholder="Type a text"
|
||||
onChange={(e) => {
|
||||
setMyValue(e.target.value);
|
||||
onChange(e.target.value);
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue