-3
I’m trying to render the component Feed
within that Main
in jsx, but I’m not getting it.
Follows the code:
function Feed(props){
return(
<main className='post'>
<p id='nome'>{props.name}</p>
<p id='texto'>{props.text}</p>
<p id='reacoes'>
<ThumbUpIcon id='like' color='primary'/>
<ThumbDownAltIcon id='deslike' color='secondary'/>
<button id='detalhes'>Ver Detalhes</button>
</p>
</main>
)
}
export default function Feeds(){
const criarPostagem = e => Feed
return(
<Main>
<div>
<input
type='text'
id='postar'/>
<button onClick={criarPostagem} id='botaoPostar'>postar</button>
</div>
<Feed/>
</Main>
)
}
The Main
is just one styled component
. I put a Feed
in the return
only for demonstration in the image, but I want to add a Feed
whenever you click the button Postar
example: https://answall.com/a/484404/54880
– novic
This answers your question? Button Ubmit and building components dynamically in Reactjs
– novic