mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
33 lines
605 B
JavaScript
33 lines
605 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
export default {
|
|
title: 'addons/useGlobalArgs',
|
|
};
|
|
|
|
export const PassedToStory = ({ globalArgs }) => {
|
|
return (
|
|
<div>
|
|
<h3>Global args:</h3>
|
|
<pre>{JSON.stringify(globalArgs)}</pre>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
PassedToStory.propTypes = {
|
|
globalArgs: PropTypes.shape({}).isRequired,
|
|
};
|
|
|
|
export const SecondStory = ({ globalArgs }) => {
|
|
return (
|
|
<div>
|
|
<h3>Global args (2):</h3>
|
|
<pre>{JSON.stringify(globalArgs)}</pre>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
SecondStory.propTypes = {
|
|
globalArgs: PropTypes.shape({}).isRequired,
|
|
};
|