Hi! I would like to view the React Component crea...
# javascript
s
Hi! I would like to view the React Component created by Kotlin/JS in Storybook. But it seems impossible to get a specific Component from the JS generated by
browserDevelopmentWebpack
and load it into the Storybook. Also, a file simply transpiled to JS will cause great difficulty in resolving library dependencies for `kotlin-wrappers`(Because the npm module distribution has stopped since pre.91😭) Do you have any good ideas about this?
t
But it seems impossible to get a specific Component from the JS generated by 
browserDevelopmentWebpack
 and load it into the Storybook.
specific Component = separate JS file?
s
@turansky
specific Component = separate JS file?
Yes. If I can handle React Component implemented in Kotlin/JS from JS, as shown below, I will be able to meet the requirements.
Copy code
import React from 'react';
import { action } from '@storybook/addon-actions';
import TestButton from '../build/js/test-component'; // ←from Kotlin/JS artifacts

export default {
  component: TestButton,
  title: 'TestButton',
};

export const text = () => <TestButton onClick={action('clicked')}>Hello Button</TestButton>;
t
Looks like webpack plugin can help you
s
Thanks for the idea! I’ll give it a try 😎