Answer the question
In order to leave comments, you need to log in
What renders faster?
Often in react markup you have to make "extra" , in connection with which the question is - will there be a difference in performance?
between this example..<div>
<div>
<div>
<p>Hello</p>
</div>
</div>
<div>
<p>Hello</p>
</div>
Text
that renders any text on the page with the given parameters. Initially the component was just <p>
, but for the tooltip, I need a container with display: relative
:return (
<div style={{display: 'relative'}}>
<p>{text}</p>
<div className={styles.tooltip}>
{text}
</div>
</div>
)
Answer the question
In order to leave comments, you need to log in
Usually your component consists of one or a set of tags.
If one tag is returned, then there seems to be no problem (correct me if I'm wrong).
If a set of tags, then you probably need a wrapper for them, which means that the output will again have one tag.
Why do you need it in this case div>div>p
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question