Skip to content

Commit

Permalink
There was a try / catch block that passed all JS errors to a componen…
Browse files Browse the repository at this point in the history
…t that did not exist. I updated this and also called a console.error to get a stack trace on the actual file and line that was is causing the problem.

Also fixed the flag component to add the additional position properties that were missing, which causes warnings on every page view.
  • Loading branch information
manifestinteractive committed Jun 29, 2015
1 parent ab12190 commit 88cebc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/src/CustomComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ var CustomComponent = React.createClass({
}
} catch (err) {
this.setTimeout(function() {
if(typeof console !== 'undefined')
{
console.error(err);
}
React.render(
<UIToolkit.BootstrapAlert bsStyle="danger">{err.toString()}</UIToolkit.BootstrapAlert>,
<div className="alert alert-danger">{err.toString()}</div>,
mountNode
);
}, 500);
Expand Down
15 changes: 14 additions & 1 deletion src/components/flag/code/views/flagView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ module.exports = React.createClass({
propTypes: {
purpose: React.PropTypes.oneOf(['default', 'primary', 'secondary', 'success', 'warning', 'danger', 'info']),
size: React.PropTypes.oneOf(['default', 'small', 'medium', 'large', 'extra-large']),
position: React.PropTypes.oneOf(['top', 'right', 'bottom', 'left'])
position: React.PropTypes.oneOf([
'top',
'right',
'bottom',
'left',
'top left',
'bottom left',
'top right',
'bottom right',
'left top',
'left bottom',
'right top',
'right bottom'
])
},

render: function() {
Expand Down

0 comments on commit 88cebc8

Please sign in to comment.