How i can extend my jsx element using construction like <extendFunc.div>

Viewed 62

Frankly speaking, it is even difficult to formulate the question, since did not work with it before. Several times I've seen React libraries that extend the jsx properties of an element using it as an object field (at least it looks like this). I recently came across another library with a similar implementation - framer motion. The point is that if I want to add animation to my element, I must add a motion object to my jsx element, as a result, its will be looks like this - <motion.span> text </motion.span>

Actually the question. Could you explain to me how it works? Is this a simmilar to higher-order component?

0 Answers
Related