import React, { Component } from 'react' import PropTypes from 'prop-types' import onClickOutsideAddon from 'react-onclickoutside' class LoginForm extends Component { static propTypes = { loginFormAuthToken: PropTypes.string, closeBox: PropTypes.func } constructor(props) { super(props) this.state = { token: '' } } componentDidMount() { const token = document.head.getElementsByTagName('meta')['csrf-token'].content this.setState({token}) } emailInputDidMount(node) { node && node.focus() } handleClickOutside = () => { this.props.closeBox() } render () { return
} } export default onClickOutsideAddon(LoginForm)