I am using Typography component as below. I am not facing any error. But i just want to know whether it is the right value i am passing to component property of typography compo
Typography is a fairly simple component. All it does is specify className
on the component such that the text is styled appropriately.
Your sample code is roughly equivalent to:
<div className="potentially-multiple-classes-determined-by-Typography" style={{ padding: 8 }}>
{props.children}
</div>
The component
prop can be anything that is valid to use as an element type in JSX. Typography will use the component prop (which defaults to 'p' if no component
prop or variant
prop is specified) to render an element that it passes class names to and it also passes through any properties that aren't part of the Typography API (which is why the style
and children
properties get passed through to the component in this example).