I have build a primereact project on top of create-react app and works when developing the app. However, when I build the app for production my links in the primereact menu no longer work. So basically it looks like the "command:" callback method doesn't seem to work. I have a router set up in my App.js file that looks like this:
Code: Select all
<Router basename={'/ReactAppLocal'}>
<div className="App">
<Route path ="/" exact component={Dashboard}/>
<Route path ="/NewFieldOrderSearch" component={NewFieldOrderSearch}/>
</div>
</Router
Code: Select all
let items= [
{
label: 'Field Order',
icon: 'fa fa-fw fa-file-o',
items: [
{ label: "New", icon: 'fa fa-fw fa-plus', command: () => {window.location = "/NewFieldOrderSearch"} },
{ label: "Search", icon: 'fa fa-fw fa-search', command: () => { window.location = "/" } },
]
}
];