Skip to content

Instantly share code, notes, and snippets.

@Goldziher
Created August 1, 2021 06:49
Show Gist options
  • Save Goldziher/aae5ffd5a354a4096a1362551d4d9cc1 to your computer and use it in GitHub Desktop.
Save Goldziher/aae5ffd5a354a4096a1362551d4d9cc1 to your computer and use it in GitHub Desktop.
Example usage of Interface Forge factory in storybook
import { Meta } from '@storybook/react';
import { UserDTO } from '@shared/dto/User.dto';
import { UserDTOFactory } from '@shared/factories/User.dto.factory';
import React from 'react';
import UserProfile from '@frontend/pages/user-profile';
export default {
title: 'Users/Profile',
component: UserProfile,
} as Meta;
export const UserProfileStory = ({
user,
}: {
user: UserDTO;
}): React.ReactElement => <UserProfile user={user} />;
UserProfileStory.args = {
user: UserDTOFactory.buildSync(),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment