passing children step-2

main
Gerardo Marx 2 weeks ago
parent 4c9416b1b3
commit 777d55dd58

@ -4,7 +4,7 @@ import Alert from "./components/Alert";
function App() {
return (
<div>
<Alert text="Hello Marx"/>
<Alert>Hello Marx</Alert>
</div>
);
}

@ -1,10 +1,10 @@
interface Props{
text: string;
children: string;
}
function Alert({text} : Props) {
function Alert({children} : Props) {
return (
<div className="alert alert-primary">{text}</div>
<div className="alert alert-primary">{children}</div>
)
}

Loading…
Cancel
Save