From 5fdfdfd56c2999893aacaa397484caa39f34a604 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 19 Oct 2016 09:25:10 -0400 Subject: [PATCH] Allow Blocks and Stage to provide a default VM So that it's easier to use these standalone. --- src/containers/blocks.js | 5 +++-- src/containers/stage.js | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/containers/blocks.js b/src/containers/blocks.js index 968ebaed6..a43f18b9a 100644 --- a/src/containers/blocks.js +++ b/src/containers/blocks.js @@ -97,7 +97,7 @@ Blocks.propTypes = { dragShadowOpacity: React.PropTypes.number }) }), - vm: React.PropTypes.instanceOf(VM).isRequired + vm: React.PropTypes.instanceOf(VM) }; Blocks.defaultOptions = { @@ -119,7 +119,8 @@ Blocks.defaultOptions = { }; Blocks.defaultProps = { - options: Blocks.defaultOptions + options: Blocks.defaultOptions, + vm: new VM() }; module.exports = Blocks; diff --git a/src/containers/stage.js b/src/containers/stage.js index 2e2184e72..11cf4b9e2 100644 --- a/src/containers/stage.js +++ b/src/containers/stage.js @@ -91,7 +91,11 @@ class Stage extends React.Component { } Stage.propTypes = { - vm: React.PropTypes.instanceOf(VM).isRequired + vm: React.PropTypes.instanceOf(VM) +}; + +Stage.defaultProps = { + vm: new VM() }; module.exports = Stage;