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.

Controls not working

See original GitHub issue

Describe the bug I followed the tutorial that is being described in this article. Controls tab is being displayed but there is a message saying that This story is not configured to handle controls. Learn how to add controls » and controls can’t be used.

To Reproduce Steps to reproduce the behavior:

  1. Create a story and paste the following code (same code provided in the tutorial)
import React from 'react'
import { Button } from '@storybook/react/demo';
export default { title: 'Button/Controls', component: Button };
export const Basic = (args: any) => <Button {...args} />;
Basic.args = { children: 'hello' };

Expected behavior Able to edit controls

Screenshots screenshot 2020-08-20 at 13 47 54

Additional context

"@storybook/addon-actions": "^6.0.13",
    "@storybook/addon-controls": "^6.0.13",
    "@storybook/addon-knobs": "^6.0.13",
    "@storybook/addon-links": "^6.0.13",
    "@storybook/addons": "^6.0.13",
    "@storybook/preset-create-react-app": "^3.1.4",
    "@storybook/react": "^6.0.13",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:33 (16 by maintainers)

github_iconTop GitHub Comments

10reactions
astorijecommented, Aug 24, 2020

@astorije do you have a repro?

Thanks for replying! I was playing with this just now, and somehow got it to work by replacing:

  argTypes: {
    value: { control: 'text' },
  },

with:

  argTypes: {
    value: { control: { type: 'text' } },
  },

Even though the doc doesn’t say so. 🤯

8reactions
mohit242commented, Oct 1, 2020

I am currently working with Gatsby + Storybook + Typescript and storybook is not auto-detecting controls for any of the components. eg-

import React from "react"
import { Story, Meta } from "@storybook/react"
// default import
import  StyledButton, {StyledButtonProps } from "./StyledButton.styles"

export default {
  title: "Components/StyledButton",
  component: StyledButton,
} as Meta

const Template: Story<StyledButtonProps> = args => <StyledButton {...args} />

// controls are not detected
export const Basic= Template.bind({})

But, everything starts working when I make the component into a named export, instead of a default export.

import React from "react"
import { Story, Meta } from "@storybook/react"
// named import
import {StyledButton, StyledButtonProps } from "./StyledButton.styles"

export default {
  title: "Components/StyledButton",
  component: StyledButton,
} as Meta

const Template: Story<StyledButtonProps> = args => <StyledButton {...args} />

// controls are auto-detected
export const Basic= Template.bind({})
Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Fixes to Left/Right Control Key Not Working on Windows 10
Reasons for Control Key Not Working; Fix 1: Check If There Is a Physical Issue; Fix 2: Adjust Settings in Control Panel; Fix...
Read more >
How to Fix Remote Controls Not Working - Support.com's
Lift the back cover up and away from the remote. Remove and re-insert the 2 batteries. Replace the back cover on the remote,...
Read more >
Both CTRL keys not working - Microsoft Community
I am currently using a Lenovo laptop Y40 with windows 10 installed. Both of my CTRL key are not working and it might...
Read more >
Troubleshoot your Xbox Wireless Controller
To turn off the controller, press and hold the Xbox button for 5-10 seconds, until the controller powers off. Then press and hold...
Read more >
Solution for controls not working after recent game update on ...
To resolve this, you can switch to default controls in the event that an update is rolled out and smart controls are not...
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