Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Update demo components to be compatible with React 15.2 and up
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Barone committed Aug 5, 2016
1 parent 0bf2646 commit 2b82374
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion demo/components/box.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var _ = require('lodash');
var React = require('react');

require('../css/polyfill.css');
Expand Down Expand Up @@ -51,11 +52,14 @@ var Box = React.createClass({
opacity: 0.4,
};

// Pass any props that are not our own on through.
var restProps = _.omit(this.props, _.keys(this.constructor.propTypes));

// outer div below absorbs Velocity's display: block behavior, keeping it from overwriting
// the display: flex
return (
<div style={{margin: 10}}>
<div {...this.props} className="flex-box flex-column justify-content-center align-items-center user-select-none" style={style}>
<div {...restProps} className="flex-box flex-column justify-content-center align-items-center user-select-none" style={style}>
{this.props.children}
{this.props.instruction ? <div style={instructionStyle}>{this.props.instruction}</div> : null}
</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/examples/toggle-box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var ToggleBox = React.createClass({
return (
<div className="flex-box flex-column flex-1 align-items-center">
<div>
<select rvalue={this.state.effect} onChange={this.whenSelectChanged}>{this.renderEffects()}</select>
<select value={this.state.effect} onChange={this.whenSelectChanged}>{this.renderEffects()}</select>
</div>
<Box className="flex-1 flex-box flex-column align-items-center" style={{backgroundColor: '#f5f5f5'}} onClick={this.whenToggleClicked} instruction="Click!">
{/*
Expand Down
2 changes: 1 addition & 1 deletion demo/examples/trigger-box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var TriggerBox = React.createClass({
return (
<div className="flex-box flex-column flex-1 align-items-center">
<div>
<select rvalue={this.state.effect} onChange={this.whenSelectChanged}>{this.renderEffects()}</select>
<select value={this.state.effect} onChange={this.whenSelectChanged}>{this.renderEffects()}</select>
</div>
<div className="flex-1">
{/*
Expand Down

0 comments on commit 2b82374

Please sign in to comment.