storybook/docs/snippets/react/my-component-with-env-variables.js.mdx
2021-02-23 00:26:03 +00:00

20 lines
383 B
Plaintext

```js
// MyComponent.stories.js
import React from 'react';
import MyComponent from './MyComponent';
export default {
component: MyComponent,
title: 'A story using environment variables inside a .env file',
};
const Template = (args) => <MyComponent {...args} />;
export const Default = Template.bind({});
Default.args = {
propertyA: process.env.STORYBOOK_DATA_KEY,
};
```