asdefined as An element type to render as (string or function).in most components in a semantic-UI reaction. What does it mean?
as
An element type to render as (string or function).
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.
Sidebar as={Menu}
<Menu.Item name='...'>
<Menu/>
, HTML . , . .
Sidebar , Sidebar Menu. , , , , .
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:
react-router
<Menu.Item as={Link} to='/home' /> // will produce <a class="item" href="/home">