question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[addon-knob] magic characters block the knob rendering

See original GitHub issue

Describe the bug

The following story gives a in correct knobs:

To Reproduce

Stept to reproduce:

  1. Add the following fake story:
import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean as bool, text } from '@storybook/addon-knobs';

const X = () => <div>X</div>;

storiesOf('X', module).add('X', () => {
  return (
    <X
      name="checkbox"
      meta={{
        submitting: bool('meta.submitting', false),
        pristine: bool('meta.pristine', true),
        error: text('meta.error', ''),
      }}
    />
  );
});
  1. see no meta.pristine, meta.error appears; however no errors get printed. 👀

Note: <comething> is potentially be magical, and in some setup it won’t be magical (i.e. working as expected…)

Expected behavior It should show 3 knobs.

Screenshots N/A

Code snippets N/A

System:

  • OS: MacOS
  • Device: Macbook Air 2013
  • Browser: ALL
  • Framework: React
  • Addons: Addon-knobs
  • Version: at least since v5.0.2

Additional context related: #6243. reproduced by: @Armanio (see here)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
leoylicommented, Aug 11, 2019

@maximeg, oh thank you to bring this up!

@shilman, I think we need to change the setting on the stale bot do not close the bug tag…

@ndelangen, I was looking a bit but get lost… It seems the root cause is not this addon but the internal lib. I believe the root cause is how storybook serialize the message exchanged via the channel… any idea?!

1reaction
maximegcommented, Aug 11, 2019

Hi @leoyli, the stale bot closed it, but this is still an issue as of @storybook/addon-knobs version 5.1.10:

  const name = text("(props) entry.account.name", "John Doe");
  const screenName = text("(props) entry.account.screenName", "johndoe");
  const title = text("(props) entry.item.title", "The title");

image

Without the dots, that’s fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[addon-knob] magic characters block the knob rendering · Issue ...
Describe the bug The following story gives a in correct knobs: To Reproduce Stept to reproduce: Add the following fake story: import React...
Read more >
Knobs Addon | Storybook: Frontend workshop for UI ...
Button knobs cause the story to re-render after the handler fires. You can prevent this by having the handler return false . withKnobs...
Read more >
@storybook/react-native-server | Yarn - Package Manager
... the boolean knob renders a switch which lets you toggle a value between true ... Core: Fix infinite loop with special characters...
Read more >
MIGRATION.md - Storybook - Fossies
Deprecated addon-knobs; Deprecated scoped blocks imports ... dynamic snippet rendering) out of @storybook/addon-docs and into the specific framework ...
Read more >
CHANGELOG.md ... - GitCode
Addon-docs: Remove render preprocessing for react components w/o docgen (#11195) ... Core: Fix infinite loop with special characters in kind names (#6607) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found