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

Commit

Permalink
Merge pull request #104 from kadirahq/story-has-a-key
Browse files Browse the repository at this point in the history
Added a View wrapper with a key prop
  • Loading branch information
roonyh authored Oct 6, 2016
2 parents 9d3fb5b + a184356 commit a8469c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/preview/components/StoryView/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Component } from 'react';
import { View } from 'react-native';
import style from './style';

export default class StoryView extends Component {
constructor(props, ...args) {
Expand All @@ -17,6 +19,10 @@ export default class StoryView extends Component {
}
const { kind, story } = this.state.selection;
const context = { kind, story };
return this.state.storyFn(context);
return (
<View key={`${kind}:::${story}`} style={style.main}>
{this.state.storyFn(context)}
</View>
);
}
}
5 changes: 5 additions & 0 deletions src/preview/components/StoryView/style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
main: {
flex: 1,
},
};

0 comments on commit a8469c9

Please sign in to comment.