Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run .jsx files #18

Open
fourcolors opened this issue Sep 7, 2017 · 0 comments
Open

unable to run .jsx files #18

fourcolors opened this issue Sep 7, 2017 · 0 comments

Comments

@fourcolors
Copy link

Hi,

I have a .jsx file that I'm trying to render. I have a fresh version of storybook installed and it doesn't seem to render the .jsx file..

Here is what I'm dealing with.

import Readonly from '../app/assets/client/components/kit_checkout/Readonly';

const test = React.createElement('div', null, 'Summary of the form');
const readonlyProps = {
  editing: true,
  formValid: true,
  pristine: true,
  summary: test,
};

storiesOf('Readonly', module)
  .add('while ', () => test)
  .add('while editing', () => <Readonly {...readonlyProps} />);

The first while story renders fine, however the component doesn't. The Readyonly looks like this

import React from 'react';
import PropTypes from 'prop-types';

const Readonly = ({ editing, formValid, pristine, summary }) => (
  <div className="readonly" style={editing ? { display: 'none' } : { wordBreak: 'break-all' }}>
    {console.log(summary)}
    { (formValid || pristine) ? summary : <div className="error">Information Needed</div> }
  </div>
);

Readonly.propTypes = {
  editing: PropTypes.bool.isRequired,
  formValid: PropTypes.bool.isRequired,
  pristine: PropTypes.bool.isRequired,
  summary: PropTypes.node.isRequired,
};

export default Readonly;

do I need to configure the webpack config somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant