Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Not pulling props #10

Open
Open
@dhanson358

Description

@dhanson358

Hope I'm not being daft and missing something obvious here, but I'm following the README and not having luck getting this to operate like I would expect.

Given a simple test component app/javascript/components/Form/TextInput/TextInput.tsx:

import React from 'react';
import FieldText from '@atlaskit/field-text'

export interface ITextInputProps {
  /**
   * Name of field
   *
   * @default "input"
   **/
  name: string,
}

/**
 * Simple form input
 */
export class TextInput extends React.Component<ITextInputProps> {

  render() {
    return (
      <FieldText
        {...this.props}
      />
    );
  }
}

export default TextInput;

and it's story app/javascript/components/Form/TextInput/TextInput.stories.js

import React from 'react';

import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';

import TextInput from './TextInput'

const stories = storiesOf("Form", module);

stories.add('TextInput', withInfo()(() => (
    <TextInput
      label="Required with default value"
      required
      pattern="[A-Z]{3}"
      value="A default value!"
      name="example-text"
    />
  )));

and the .storybook/webpack.config.js of

const path = require("path");

module.exports = (baseConfig, env, config) => {
  config.module.rules.push({
    test: /\.(ts|tsx)$/,
    include: path.resolve(__dirname, "../app/javascript"),
    use: [
      require.resolve("ts-loader"),
      require.resolve("react-docgen-typescript-loader"),
    ],
  });
  config.resolve.extensions.push(".ts", ".tsx");

  return config;
};

and stories/index.stores.js of

import React from 'react';

import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { withInfo, setDefaults } from '@storybook/addon-info';

setDefaults({
  header: false, // Toggles display of header with component name and description
  inline: true,
});

I'm getting the story, but no props displayed:
image

Appreciate any guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions