ionic build
npx cap add android
ionic capacitor run android
function App(){ | |
return ( | |
<div className="App"> | |
<AddItem text="Carlos" number="1"/> | |
</div> | |
); | |
} | |
// Props are not expected to be manualy changed change | |
// function AddItem({name, number}) { // deconstructing | |
// function AddItem({name, number = 0}) { | |
function AddItem(props) { | |
// const name = props.name; | |
return ( | |
<form> | |
<label htmlFor="text-form">Something:</label> | |
<input type="text" value={props.name} id="text-form"/> | |
<span>{props.number}</span> | |
</form> | |
); | |
} | |
// DefaultProps | |
AddItem.defaultProps = { | |
name: "Jose", | |
number: 1, | |
}; | |
export default AddItem; | |