From a18435696ba53b39bfc7b84a4e8eeb67c094f05d Mon Sep 17 00:00:00 2001 From: Aruna Herath Date: Thu, 6 Oct 2016 10:22:07 +0530 Subject: [PATCH] Added a View wrapper with a key prop --- src/preview/components/StoryView/index.js | 8 +++++++- src/preview/components/StoryView/style.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/preview/components/StoryView/style.js diff --git a/src/preview/components/StoryView/index.js b/src/preview/components/StoryView/index.js index e6a51f7..89454e6 100644 --- a/src/preview/components/StoryView/index.js +++ b/src/preview/components/StoryView/index.js @@ -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) { @@ -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 ( + + {this.state.storyFn(context)} + + ); } } diff --git a/src/preview/components/StoryView/style.js b/src/preview/components/StoryView/style.js new file mode 100644 index 0000000..61b48b7 --- /dev/null +++ b/src/preview/components/StoryView/style.js @@ -0,0 +1,5 @@ +export default { + main: { + flex: 1, + }, +};