아따 대가리 깨지네
예시 만듬
This commit is contained in:
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
@@ -5,15 +5,20 @@ import { main } from "@/wailsjs/go/models";
|
||||
import React, {useState} from "react";
|
||||
|
||||
export default function Home() {
|
||||
const [person, setPerson] = useState(new main.Person());
|
||||
const [person, setPerson] = useState(new main.Person({name: "", age: 0}));
|
||||
const [result, setResult] = useState('Please enter your name below 👇');
|
||||
|
||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>, field: string) => {
|
||||
setPerson(prevPerson => ({
|
||||
setPerson(prevPerson => {
|
||||
const updatedPerson = {
|
||||
...prevPerson,
|
||||
[field]: field === 'age' ? parseInt(e.target.value) : e.target.value,
|
||||
convertValues: prevPerson.convertValues // 기존 convertValues 속성 유지
|
||||
}));
|
||||
[field]: field === 'age' ? parseInt(e.target.value) : e.target.value
|
||||
};
|
||||
return {
|
||||
...updatedPerson,
|
||||
convertValues: prevPerson.convertValues.bind(updatedPerson)
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
return <>
|
||||
|
||||
Reference in New Issue
Block a user