- Issue created by @johnny5th
When storybook makes a render request from Drupal, it passes all arguments through php json_decode before sending off to the renderer. Arguments are automatically cast to the best fitting PHP type. In cases where your component property is a string type, but you pass a number as the input, PHP automatically assumes it should be an int/double and the renderer throws an exception.
We need to have a way for the renderer to attempt to cast incoming arguments to their defined type (if available) in the component or story definition.
An exception has been thrown during the rendering of a template ("[stat] Double value found, but a string or an object is required").
Create a component with a string property and an associated story. The story should have a quoted integer/float as the default value on the property. Display the component in Storybook.
Load the story or referenced component somehow and provide the renderer with type definitions. Storybook has an 'argTypes' option that lets you define types for each argument, maybe we could use that.
Active
1.0
Components