mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
21 lines
522 B
Plaintext
21 lines
522 B
Plaintext
```ts
|
|
// MyComponent.stories.ts | MyComponent.stories.tsx
|
|
|
|
import React from 'react';
|
|
|
|
import { Story, Meta } from '@storybook/react/types-6-0';
|
|
|
|
import { MyComponent, MyComponentProps } from './MyComponent';
|
|
|
|
export default {
|
|
component: MyComponent,
|
|
title: 'A story using environment variables inside a .env file',
|
|
} as Meta;
|
|
|
|
const Template: Story<MyComponentProps> = (args) => <MyComponent {...args} />;
|
|
|
|
export const Default = Template.bind({});
|
|
Default.args = {
|
|
propertyA: process.env.STORYBOOK_DATA_KEY,
|
|
};
|
|
``` |