tajo / ladle

🥄 Develop, test and document your React story components faster.
https://www.ladle.dev
MIT License
2.63k stars 93 forks source link

argTypes converts numbers to string #430

Closed Hurtak closed 1 year ago

Hurtak commented 1 year ago

Describe the bug

When using argTypes with type radio or inline-radio (and probably some others, like select) it converts the data to string.

I think it should keep the data types as they are

Reproduction

export const Default = ({ 
  size // size prop is string here
}) => {
  return (
    <Icon size={size}></Icon>
  );
};
Default.argTypes = {
  size: {
    // size prop data defined as numbers
    options: [14, 16, 22, 30],
    defaultValue: 30,
    control: { type: 'inline-radio' },
  },
};