Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
89
rated 0 times [  96] [ 7]  / answers: 1 / hits: 33427  / 7 Years ago, tue, february 7, 2017, 12:00:00

I'm trying to get a semantic ui (react) menu list, which should be working with react router, which means I would like to use the Link component of react router



If I use this...



<Menu.Item name='profile'>
<Icon name='user' />
My profile
</Menu.Item>


...it gives me the result:



<a class=item>
<i aria-hidden=true class=user icon></i>
My profile
</a>


But I would like to get something like



<Link to='profile'>
<i aria-hidden=true class=user icon></i>
My profile
</Link>


This one doesn't work, as the syntax is wrong:



<Menu.Item name='profile' as={ <Link to='profile' /> }>
<Icon name='user' />
My profile
</Menu.Item>

More From » reactjs

 Answers
1

You need use the SUIR's augmentation:



<Menu.Item as={ Link } name='profile' to='profile'>
<Icon name='user' />
My profile
</Menu.Item>

[#59050] Friday, February 3, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aileenreynap

Total Points: 140
Total Questions: 106
Total Answers: 99

Location: Andorra
Member since Sun, Oct 18, 2020
4 Years ago
;