Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

addDecorator should be chainable #46

Closed
jairtrejo opened this issue Jul 19, 2016 · 2 comments
Closed

addDecorator should be chainable #46

jairtrejo opened this issue Jul 19, 2016 · 2 comments

Comments

@jairtrejo
Copy link

The addDecorator function should return this so it is chainable. That would enable doing things like:

storiesOf('Favorite').addDecorator((story) => (
        <View style={{
            flexDirection: 'column',
            alignItems: 'stretch',
            justifyContent: 'center',
            flex: 1}}
        >
            { story() }
        </View>
    ))
    .add('default view', () => (
        <FavoriteComponent favorite={ simpleFavorite }
                           onPress={ action('Favorite pressed') }/>
    ))
    .add('missing URL', () => (
        <FavoriteComponent favorite={ missingURLFavorite }
                           onPress={ action('Favorite pressed') }/>
    ));

It is chainable in the React DOM version :)

Thanks in advance!

@thani-sh
Copy link
Contributor

Hi @jairtrejo
Just released v1.11.3 with a fix. It should work now.

@jairtrejo
Copy link
Author

Thank you! You guys are super fast

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants