The view is not re-rendered on toolbar change
See original GitHub issueDescribe the bug I have created a new toolbar button following the steps in the documentation, the button is for localization change, the problem is that the story won’t re-render on globals change.
Expected behavior I expect the page reloads as language is changed as it is in your official storybook
I am using @ngx-translate/core
for managing the translations.
export const globalTypes = {
locale: {
name: 'Locale',
description: 'Internationalization locale',
defaultValue: 'en',
toolbar: {
icon: 'globe',
items: [
{ value: 'en', right: 'en', title: 'English' },
{ value: 'he', right: 'he', title: 'Hebrew' },
],
},
},
};
const withLocaleProvider = (storyFunc, { globals: { locale } }) => {
const story = storyFunc();
story.moduleMetadata.imports.push(
TranslateModule.forRoot({
defaultLanguage: locale,
useDefaultLang: true,
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient],
},
})
);
return story;
}
export const decorators = [
withLocaleProvider,
];
System
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 87.0.4280.141
Edge: Spartan (44.19041.423.0), Chromium (88.0.705.56)
npmPackages:
@storybook/addon-actions: ^6.1.15 => 6.1.15
@storybook/addon-essentials: ^6.1.15 => 6.1.15
@storybook/addon-links: ^6.1.15 => 6.1.15
@storybook/angular: ^6.1.15 => 6.1.15
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:17 (3 by maintainers)
Top Results From Across the Web
How to check if your component rerendered - and why!
To enable it, go to "Profiler" >> click the "Cog wheel" on the right side of the top bar >> "General" tab >>...
Read more >screen not re-rendering after changing state - Stack Overflow
Update. Actually your app is working perfectly fine with me :/ Because you are not communicating the state change with the icon change....
Read more >How to Update Data Without Rerendering an Entire Grid in ...
This blog explains how to enable immutable rendering mode in the Syncfusion Angular Data Grid control to effectively update data with code ...
Read more >7 Rerendering Partial Page Content - Oracle Help Center
This chapter describes how to use the partial page render features provided with ADF Faces components to rerender areas of a page without...
Read more >Toolbar for Blazor - DxToolbarItem is not re-rendered after the ...
This issue can be reproduced if DxToolbarItem.NavigateUrl depends on some property. In this case, changing the DxToolbarItem.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue is still present, at least with Vue. The Vue component defined in the
decorators
array doesn’t receive the updatedglobals
value until a re-render happens some other way like when switching to a different story or the Docs tab.I noticed the same thing with vue. In the docs tab auto-reload works though.