I have seen that some libraries such as "framer-motion" from react work using this syntax, for example to insert an animated H1: <motion.h1>
which would translate to an h1 but with animations defined in the props of the component.
What I don't understand is how the "motion" component accesses that "h1" and then in the function it knows which component to render animated.
I need to create a component for example <lazy.div>
that interprets a div with certain modifications that I am going to define.
What I need to know is how to use that syntax and not the typical
<Lazy><h1>Content<h1> </Lazy>
Would it also be possible to use this type of syntax to modify chain elements or add functions to those already modified components?
For example <lazy.fullwidth.div>
Comments
Post a Comment