Allow Blocks and Stage to provide a default VM

So that it's easier to use these standalone.
This commit is contained in:
Ray Schamp committed 2016-10-19 09:25:10 -04:00
1 parent 07f5cb4995
commit 5fdfdfd56c
2 files changed
+8 -3

No files matched your search

+3 -2
View File
@@ -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;
+5 -1
View File
@@ -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;