Super Simple props Q
Answered
WhyFencePost (Ping Reply) posted this in #help-forum
Hi all, i know this is probably super dum, but idk how to do this. How do I pass this inner thing?
and MyButton is this:
how do i have the props passed to there, even if i want to add other props
<MyButton>Pass This</MyButton>and MyButton is this:
function Button() {
return (
<div className="bg-blue-300"><h1>I want the text here, but dont know how</h1></div>
);
}how do i have the props passed to there, even if i want to add other props
17 Replies
Netherland Dwarf
@WhyFencePost (Ping Reply) its called children
Netherland Dwarf
So inside Button you need a props paramter
Answer
Netherland Dwarf
Then desconstruxt children from props and render the children
For example look at your layout.js/ts file
that i know, but that tells me nothing on how to do that
Netherland Dwarf
Thats how you access children
You can look at your layout.ja
Layout.js
It does the same thing your trying to achieve
i add { children } to my code?
Netherland Dwarf
Yes but look at layout.te
The layout file
i got it
thanks
Netherland Dwarf
Notice it parameter
Yeah
Np