In the latest version of Local (Version 8.3.1+6650) custom more menu item is not rendering or doing anything.
I have tried downgrading, works. Documentation has no changes ?
It has been working so far thru out all the updates
You can try it out with simple:
// Add a new route
hooks.addContent('routes[site-info]', () => {
return (
<Route
key="myRoute"
path="/main/site-info/:siteID/myRoute"
render={(props) => <div>My Route</div>}
/>
);
});
// Add a new menu item that navigates to the new route
hooks.addFilter('siteInfoMoreMenu', function (menu, site) {
menu.push({
label: 'Go to My Route',
enabled: true,
click: () => {
context.events.send('goToRoute', `/main/site-info/${site.id}/myRoute`);
},
});
return menu;
});
It did work with previous version if local, downgrading works again
I have multiple sites on local, on none does it work
Every site is on: nginx, php@7.4/8.1, mysql both versions, tho tried with every possible viable combination, still not working
Tried boilerplater addon, MoreMenu doesn’t work at all, tools does
Nothing else changed exept for the local version, env etc is the same as it was
We don’t have anything available other than what you currently see. I know it’s not up to date but the team has been having conversations lately around our approach to add ons so that’s something that is still in flux. More to come there!
Hey @dzoniis Thanks for letting us know about this regression and sorry about the out-of-date documentation for Addons.
Can you give us a little more info about the error you are seeing as well as what version of Local you downgraded to?
I’ll be honest in saying that it’s been a while since I’ve created a new addon from scratch and when I use the code you provide within a newly created addon using npx create-local-addon it doesn’t work. That being said, that same addon/code combination doesn’t work for any version of Local that I’ve tried going back to 7.2.
My gut tells me that there’s likely some breaking and/or deprecated package dependencies out there causing issues, especially as they relate to Typescript and React versions.
If you have the Addon that you’re using available, I’d love to take a peek and see if there is anything that stands out to me.
Hello @ben.turner,
I am currently using “Version 8.2.1+6583”, and it’s working fine as it should
Tho there is no error in the console or anywhere.
Just use simple renderer.tsx
That would suffice to verify if the filter for siteInfoMoreMenu is working or not.
On the latest version it’s defaulting back to Overview tab, tho the click event is triggered but i get no rendered content of the tab itself.
You could use boilerplate coming from the npx, just add this into renderer and it should work on previously mentioned downgraded version
i could provide you with zipped version of the basic addon using this code which is working as it should if that’s okay?
Thank you @dzoniis for the follow-up! @kimmenbert I merged the highlights from your thread into here as well since you were running into the same issue. Could you check out Ben’s comment above and provide any further context that might be helpful?
@dzoniis I don’t have a timeline yet, but a fix for this should appear in the next beta and main releases (might not be the upcoming 9.0.0, but likely the one after that). Thanks for your patience.