DEV Community

kirankumar
kirankumar

Posted on

New React API proposal

For SVG icons currently, we are preferring like functional components like this

const SvgIcon = () => (
SVG icon tag...
);

here I am not taking any props for the functional component but if any updates happened parent component child component(SvgIcon) which is an SVG icon is rerendering.
Here we can use memo but the React memo is not preferable for small components like this as a component should have memoizable content (props) or complex computations.

In SVG icon we can imagine any static text () or image the same happens.

So here I am proposing like better if we anyone API (naming convention can be anything) in internal it can be wrapped with memo or else any other but it should be rendered only once

any suggestion, queries.

Thanks to all

Top comments (0)