The function withInfo(...)
in @storybook/addon-info
accepts 0 or 1 argument.
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
const { Component } = React;
storiesOf('Component', module)
.add('no info',
withInfo()(() =>
<Component>Click the "?" mark at top-right to view the info.</Component>
)
);
The example above works well in JavaScript. But it does not compile in TypeScript: TS2554: Expected 1 arguments, but got 0.
.
So I would like to modify the definition of the function withInfo
in storybook__addon-info
from...
withInfo(textOrOptions: string | Options)
...to...
withInfo(textOrOptions?: string | Options)