You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the version 4.0.0-alpha.1 with angular and works really good. The problem it is when I tried to use the Javascript API for manipulate the addon-viewport. As a panel the addon works good but when I tried to set the viewport for some stories I get the following error:
Warning: Failed prop type: Invalid prop `children` supplied to `Viewport`, expected a ReactNode.
in Viewport
and
Unhandled Promise rejection: Unexpected value 'undefined' declared by the module 'DynamicModule' ; Zone: <root> ; Task: Promise.then ; Value: Error: Unexpected value 'undefined' declared by the module 'DynamicModule'
at syntaxError (compiler.js:485)
at compiler.js:15273
at Array.forEach (<anonymous>)
at CompileMetadataResolver../node_modules/@angular/compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:15271)
My code it is:
.storybook/config.js
import { configure } from '@storybook/angular';
function loadStories() {
require('../stories/index.ts');
}
configure(loadStories, module);
Thanks @gpincheiraa for reporting this issue.
Unfortunately the viewport's decorators (a.k.a APIs) only work for React, as it uses React wrapper component internally, I should have mentioned that in the documentation though.
I believe this functionality should be supported in other libraries/frameworks (e.g. angular, vue), probably I'm gonna work on it by next week.
@danielduan@Hypnosphi Do you think we should create separate ticket for each library/framework?
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
I'm trying to use the version 4.0.0-alpha.1 with angular and works really good. The problem it is when I tried to use the Javascript API for manipulate the addon-viewport. As a panel the addon works good but when I tried to set the viewport for some stories I get the following error:
and
My code it is:
.storybook/config.js
.storybook/addons.js
stories/myStory.js
My dependencies Installed:
npm install --depth=0
Edit: You can reproduce this error on the following repo and branch:
https://github.com/gpincheiraa/storybook-components-sample/tree/addons-viewport
The text was updated successfully, but these errors were encountered: