Menu acts like static about its labels

UI Components for React
Post Reply
Posts: 6
Joined: 08 Dec 2016, 09:29

12 Nov 2017, 17:32

Hello. I have a page works in 2 languages. I have a Menu element on this page. when i switch the language, all of my labels are re-rendered accordig to new language except menu. Although its model change it does not reflect the new language. My code:

import T from 'i18n-react';

//my menu model. when i change the locale i can see that content is changing too in debug.
let items = [
{ label: T.translate("component.home"), command: () => {this.props.history.push('/');} },
{ label: T.translate("component.about"), command: () => {this.props.history.push('/about');} }

//i am switching the language from here
<Dropdown value={sessionStorage.getItem('locale')} options={languages} onChange={this.handleLocaleChange()}
handleLocaleChange(e) {
if (e.value ==='tr') {
sessionStorage.setItem('locale', 'tr');
} else if (e.value ==='en') {
sessionStorage.setItem('locale', 'en');

//My link object. It switches and shows the label correctly when language changes!
<Link to="/about" onClick={() => this.props.handlePageChange()}>

//My menu and its button. Its only visible when width < 480
//It doesn change the labels. It acts like static.
<Button className="responsiveButton" icon="fa fa-list" onClick={(event) =>}/>
<Menu model={items} popup={true} ref={el => = el}/>

Posts: 18
Joined: 18 Aug 2017, 10:57

13 Nov 2017, 13:04

Could this be related to what I described here?

viewtopic.php?f=57&t=53045&sid=c735f428 ... caf34067a3

Posts: 4569
Joined: 29 Jun 2013, 12:38

16 Nov 2017, 13:22

Could you please provide a plunker for us to replicate?

Posts: 18
Joined: 18 Aug 2017, 10:57

17 Nov 2017, 15:32

I think you can reproduce this behaviour with my plunker I provided over here.

viewtopic.php?f=57&t=53045&sid=61ccb2a3 ... 4719e34c4a

Just replace one of the labels in the "switch"-function and you can see that not only the disabled state is not re-rendered correctly, but also a change in labels.

Posts: 6
Joined: 08 Dec 2016, 09:29

19 Nov 2017, 11:26

well, this is my first plunk so i hope i did it right.
my problem is that; when i update the state, button label changes but menu not!

Posts: 648
Joined: 12 Sep 2017, 10:44

23 Nov 2017, 15:03

Thanks for plunker. We fixed for next version(PrimeReact 1.2.1)

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests