Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import React, { Component } from 'react'
import { object } from 'prop-types'
import { renderRoutes } from 'react-router-config'
import Header from './components/Header'
class App extends Component {
static displayName = 'App';
static propTypes = {
route: object.isRequired
};
render() {
const styles = require('./App.scss')
const { route } = this.props
return (
<div>
<header>
{ renderRoutes(route.routes) }
</header></div>
)
}
}
<div>
{favorite}
{spotify}
</div>
);
}
});
export default createReactClass({
displayName: "SongList",
propTypes: {
songs: array.isRequired,
favBus: object.isRequired,
playBus: object.isRequired
},
getInitialState: function() {
return {
selectedSongId: null
};
},
onFavorite: function(song) {
this.props.favBus.push({
type: song.favorite ? "remove" : "add",
song: song
});
},
onSelect: function(song) {
var selectedSongId = song.id === this.state.selectedSongId ? null : song.id;
this.setState({ selectedSongId });
{getModalBody()}
);
}
}
NewStoryModal.propTypes = {
createInterviewee: func.isRequired,
createStory: func.isRequired,
deleteInterviewee: func.isRequired,
handleClose: func.isRequired,
isOpen: bool.isRequired,
router: object.isRequired,
stories: arrayOf(object),
updateInterviewee: func.isRequired,
updateStory: func.isRequired,
user: object.isRequired,
};
NewStoryModal.defaultProps = {
stories: [],
};
validationError={this.state.validationErrors.password}
/>
<button type="submit">
Submit
</button>
)
}
}
LoginForm.propTypes = {
dispatchLoginRequest: func.isRequired
}
LoginForm.contextTypes = {
router: object.isRequired
}
const mapStateToProps = state => {
return {
loginLoading: state.loginLocal.loginLoading
}
}
const mapDispatchToProps = dispatch => {
return {
dispatchLoginRequest (userData) {
dispatch(loginRequest(userData))
}
}
}
};
FieldDateRangeInputComponent.propTypes = {
className: string,
rootClassName: string,
unitType: propTypes.bookingUnitType.isRequired,
useMobileMargins: bool,
endDateId: string,
endDateLabel: string,
endDatePlaceholderText: string,
startDateId: string,
startDateLabel: string,
startDatePlaceholderText: string,
timeSlots: arrayOf(propTypes.timeSlot),
input: object.isRequired,
meta: object.isRequired,
focusedInput: oneOf([START_DATE, END_DATE]),
onFocusedInputChange: func,
};
const FieldDateRangeInput = props => {
return ;
};
export { DateRangeInput };
export default FieldDateRangeInput;
import { themeColors, appColors } from 'utils/color';
import ShapeVertex from './ShapeVertex';
import Portal from 'react-portal';
import ShapeEditorPopover from './ShapeEditorPopover';
import withProjectContext from 'views/Project/withProjectContext';
import { TOOL_TYPES } from 'views/Project/Container';
const propTypes = {
scaleObj: object.isRequired,
activeTool: string.isRequired,
isPlaying: bool.isRequired,
tempo: number.isRequired,
points: array.isRequired,
attrs: object.isRequired,
noteIndexModifier: number.isRequired,
colorIndex: number.isRequired,
index: number.isRequired,
volume: number.isRequired,
isSelected: bool.isRequired,
isMuted: bool.isRequired,
isDragging: bool.isRequired,
isSoloed: bool.isRequired,
dragBoundFunc: func.isRequired,
handleDrag: func.isRequired,
handleDragStart: func.isRequired,
handleDragEnd: func.isRequired,
context: {
firebase: {
auth: firebase.auth.Auth,
firestore: firebase.firestore.Firestore,
messaging: firebase.messaging.Messaging,
selectAuth: (state: StoreState) => any,
storage: firebase.storage.Storage,
store: Store
}
};
static displayName = 'ConnectAuth';
static WrappedComponent = WrappedComponent;
static contextTypes = {
firebase: object.isRequired
};
constructor(props: Props, context: any) {
super(props, context);
this.state = { doc: emptyObject, fetchStatus: FetchStatus.LOADING };
this._loaded = false;
}
componentWillMount() {
const { store } = this.context.firebase;
this._unsubscribe = store.subscribe(this._handleState);
this._handleState();
}
componentWillUnmount() {
if (this._unsubscribe) {
);
LeafPage.propTypes = {
page: object.isRequired,
direction: number.isRequired,
position: object.isRequired,
drag: func.isRequired
};
export default enhancer(LeafPage);
import { Component } from 'react';
import { string, func, object } from 'prop-types';
import TreeView from 'react-treeview';
import 'react-treeview/react-treeview.css';
import Error from '../../components/Error';
export default class HookBrowser extends Component {
static propTypes = {
group: string.isRequired,
hookGroupId: string,
hookId: string,
selectHook: func.isRequired,
hooks: object.isRequired
};
constructor(props) {
super(props);
this.state = {
hooksList: null,
error: null
};
}
componentWillMount() {
this.loadHooksList(this.props);
}
componentWillReceiveProps(nextProps) {