Все равно, в массив значение добавляется, но бг не меняется
import React from 'react'
import './Layout.scss'
import NavBar from '../components/navBar/NavBar'
import Footer from '../components/footer/Footer'
class Layout extends React.Component {
state = {
isHovered: false,
list: [
{name: 'Behance', id: 1, background: 'blue'},
{name: 'Dribbble', id: 2, background: 'red'},
{name: 'Instagram', id: 3, background: 'green'},
],
cls : [
'Layout'
]
}
handleHover = () => {
this.setState(prevState => ({
isHovered: !prevState.isHovered
}));
}
render (){
return (
<div className = {this.state.cls.join('')}>
<NavBar/>
<Footer
list = {this.state.list}
hover = {this.handleHover = this.handleHover.bind(this)}
cls = {this.state.cls}
handleState = {this.handleState}
/>
</div>
)
}
}
export default Layout