What is the “how” attribute in the semantics-ui-reaction components?

asdefined as An element type to render as (string or function).in most components in a semantic-UI reaction. What does it mean?

I understand that it somehow changes the component in everything that is as.

Example:

https://react.semantic-ui.com/modules/sidebar has Sidebar as={Menu}, then children <Menu.Item name='...'>without the typical <Menu/>one that is required to run the menu.

+6
source share
1 answer

, HTML . , . .

Sidebar , Sidebar Menu. , , , , .

<Sidebar>
  <Menu>
    <Menu.Item />
  </Menu>
</Sidebar>

:

<Button /> // will produce <button class='ui button' />
<Button as='a' /> // will produce <a class='ui button' />

react-router:

<Menu.Item as={Link} to='/home' /> // will produce <a class="item" href="/home">
+5

All Articles