Skip to content

Instantly share code, notes, and snippets.

@ahayes91
Last active September 26, 2021 10:33
Show Gist options
  • Save ahayes91/feda467b4b550438a4b937355f135531 to your computer and use it in GitHub Desktop.
Save ahayes91/feda467b4b550438a4b937355f135531 to your computer and use it in GitHub Desktop.
import React from 'react';
import { getEnvironment } from 'get-environment';
const localOnlyDecorator = story => {
const env = getEnvironment();
// Only show app stories on local for now
if (env === 'local' || env === 'development') {
return story();
}
return <p>This story can only be viewed when running Storybook locally.</p>;
};
export default localOnlyDecorator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment