import {Login, LoginWrap, DataInput} from '../styledComponents/login.js'
return(
<LoginWrap>
<Login>
<img src={logo} alt='logo'/>
<h3>Login</h3>
<DataInput>
<input placeholder='Login' ref={loginInput}/>
<input placeholder='Password' type='password' ref={passInput}/>
</DataInput>
<span>{loginError}  </span>
<input type='submit' value='Login' onClick={onLogin}/>
</Login>
</LoginWrap>
)
<div id="app"></div>
function App() {
const [ dark, setDark ] = React.useState(null);
const updateDark = e => setDark(e.type === 'mouseover' ? e.currentTarget.id : null);
return (
<React.Fragment>
{[ 'left', 'right' ].map(n => (
<div
id={n}
key={n}
onMouseOver={updateDark}
onMouseLeave={updateDark}
className={dark && dark !== n ? 'dark' : ''}
></div>
))}
</React.Fragment>
);
}
ReactDOM.render(<App />, document.getElementById('app'));
class Component {
constructor(props) {
this.props = props;
}
}
import React, { Component } from 'react';
import { Collapse, Button, CardBody, Card } from 'reactstrap';
class Example extends Component {
state = {
collapse: false
};
toggle = () => {
this.setState(state => ({ collapse: !state.collapse }));
}
render() {
return (
<div>
<Button color="primary" onClick={this.toggle} style={{ marginBottom: '1rem' }}>Toggle</Button>
<Collapse isOpen={this.state.collapse}>
<Card>
<CardBody>
Anim pariatur cliche reprehenderit,
enim eiusmod high life accusamus terry richardson ad squid. Nihil
anim keffiyeh helvetica, craft beer labore wes anderson cred
nesciunt sapiente ea proident.
</CardBody>
</Card>
</Collapse>
</div>
);
}
}
export default Example;
В чем причина?