Allow Blocks and Stage to provide a default VM
So that it's easier to use these standalone.
This commit is contained in:
1 parent
07f5cb4995
commit
5fdfdfd56c
2 files changed
+8
-3
No files matched your search
@@ -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;
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user