Relative Content

Tag Archive for reactjsstorybook

window.location.hash not defined upon pasting url containing hash

I got Storybook project where I have story with 100+ icons in it, I wrapped each icon with tag and assign corresponding icon name at the end of the
href={/?path=/story/design-system-v2-foundations-iconography--all-icons#${data.name}} and added id with the same data.name value.

Setting Default Property Values in React Component

Trying to set the default value for some of my component properties. Doing a simple string or boolean works just fine, but I can’t find any examples showing something more complex. I’ve tried a few things without success:

How can I transfer functions to my components in the storybook8?

I am currently using Storybook8 and have implemented a checkbox component.
I am trying to pass setChecked as a prop to see the checkbox in action when clicked, but I am finding it difficult to implement this even after consulting the Storybook 8 documentation.
How can I set up the component so that I can pass setChecked and know when the checkbox is checked?