« Max reacjsex » : différence entre les versions
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 36 : | Ligne 36 : | ||
<syntaxhighlight lang="js" line copy>// components/common/ZoneNumerique.jsx | <syntaxhighlight lang="js" line copy>// components/common/ZoneNumerique.jsx | ||
export const ZoneNumerique = ({ value, onChange, disabled }) = | export const ZoneNumerique = ({ value, onChange, disabled }) => { | ||
return ( | return ( | ||
<input | |||
type= | type="number" | ||
value={value} | value={value} | ||
onChange={(e) = | onChange={(e) => onChange(e.target.value)} | ||
disabled={disabled} | disabled={disabled} | ||
/ | /> | ||
); | ); | ||
}; | |||
};</syntaxhighlight> | };</syntaxhighlight> | ||
<syntaxhighlight lang="jsx" line copy>// components/common/Bouton.jsx | <syntaxhighlight lang="jsx" line copy>// components/common/Bouton.jsx | ||
export const Bouton = ({ label, onClick, disabled }) = | export const Bouton = ({ label, onClick, disabled }) => { | ||
return ( | return ( | ||
<button onClick={onClick} disabled={disabled}> | |||
{label} | {label} | ||
</button> | |||
); | ); | ||
}; | |||
};</syntaxhighlight> | };</syntaxhighlight> | ||