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

linkTo another story error #174

Closed
darul75 opened this issue May 7, 2016 · 12 comments
Closed

linkTo another story error #174

darul75 opened this issue May 7, 2016 · 12 comments

Comments

@darul75
Copy link

darul75 commented May 7, 2016

Hi guys,

I try to figure out what can produce that error when clicking a button with a specific handler to switch to another named story:

page_bus.js?147f:40 Uncaught Error: dataId is not supplied via queryString

const props = {
    handleSignIn: function() {
      linkTo('Tab', 'empty');
    }
  }
};

storiesOf('Login', module)
  .add('empty', () => (
    <Login {...props} />
));
@arunoda
Copy link
Member

arunoda commented May 9, 2016

@darul75 Try this:

const props = {
    handleSignIn: linkTo('Tab', 'empty'),
  }
};

Then it'll work.

@darul75
Copy link
Author

darul75 commented May 9, 2016

ok fine, thx

@darul75 darul75 closed this as completed May 9, 2016
@darul75
Copy link
Author

darul75 commented May 9, 2016

Hi,

I have tried but result is still the same

capture d ecran 2016-05-09 a 21 07 27

linkTo is giving error and action dump to console but trigger same error

@darul75 darul75 reopened this May 9, 2016
@arunoda arunoda added the bug label May 9, 2016
@arunoda
Copy link
Member

arunoda commented May 9, 2016

Okay. I'll have look at them do a fix if we can ASAP.

@arunoda
Copy link
Member

arunoda commented May 10, 2016

This seems not like a linkTo issue. But something else, if there anyway you can provide a repo where we can reproduce this issue.

@arunoda arunoda removed the bug label May 10, 2016
@darul75
Copy link
Author

darul75 commented May 10, 2016

first thanks for giving feedback quickly, I need to extract and reproduce the case in a small repo as I am not allowed to share it with you.

@RajnishDashora
Copy link

RajnishDashora commented May 30, 2016

+1, facing the same issue.

@necolas
Copy link
Contributor

necolas commented Aug 22, 2016

We were having a similar issue after updating from 1.x to 2.3.0 (also unrelated to linkTo). In our case, the issue was that the way storybook works with the custom webpack config appears to have changed. The storybook config include the HtmlWebpackPlugin plugin (which we use for non-strorybook rendering), which previously did nothing but now it replaces the default HTML that storybook renders and breaks the init step.

@arunoda
Copy link
Member

arunoda commented Aug 23, 2016

@necolas Interesting.
I'll do a test and see what's going on here.
May be we'll remove HtmlWebpackPlugin if it exists. Since it has no effect when used with storybook.

@necolas
Copy link
Contributor

necolas commented Aug 23, 2016

I think this was just a case of my mistake :)

@Ne-Ne
Copy link

Ne-Ne commented Sep 4, 2018

I am getting the same issues when using it with setState in react:

Problem

This is just a quick example, a button is clicked. isLoading a boolean state for react component overlay. Complete 1500 millisecond delay then it should fire linkTo() however it does not work...

handleContinueButton = () => {
    this.setState(
      {
        isLoading: true,
      },
      () => {
        setTimeout(() => {
          this.setState(
            {
              isLoading: false,
            },
            () => linkTo('section_1', 'section_1_2')
          );
        }, 1500);
      }
    );
  };

Button origin

<Button onClick={this.handleContinueButton} fluid primary size="large" content="Continue" />

Any ideas?

@ndelangen
Copy link
Member

linkTo('section_1', 'section_1_2') returns a function that when called, will navigate.

linkTo('section_1', 'section_1_2')() will navigate.

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

No branches or pull requests

6 participants