Typography vs HTML tags
تبليغيرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.
I am ambiguous using between <Typography/> tag and normal HTML tags like <p>.
<Box className={someClassName}>
<Typography>{someVariableName}</Typography>
</Box>
or
<p className=”someClassName”>{someVariableName}</p>
both serve the purpose and yet mui typography is what mui has introduced and I’ve seen it being used in MUI apps.
my doubt is what is the specific advantage I’m getting while using <Typography> tag? In order to style it, I have to use 2 tags ie <Box> and <Typography>.
but where as with HTML, I can save some typing by using <p> tag or <h1> or whatever text display tags. so, why I should use <Typography>.
only on <Box> I can write CSS classes, but for HTML directly on <p> tags I can use CSS either inline or class names.
أضف إجابة