1

Does anyone know what is the name of this type of components?

<chart.component data={...} type={...} />

I mean the usages of the '.' between chart and component

<chart.component ... />

The keyword name could be awesome to do some googling. Any article too.

Rolly
  • 3,205
  • 3
  • 26
  • 35

1 Answers1

0

The dot notation is used to represent compound components within React. The idea was introduced by Kent Dodds as an advanced react component pattern. In your example,<chart.component ... /> the .component is a static property which has been added to the <chart> component.

This pattern is frequently used in the Semantic UI React library as well. For more information checkout Kent's blog as well as this blog article as they get into more specific use cases and examples of this pattern.

Hopefully that helps!

Nathan
  • 7,853
  • 4
  • 27
  • 50