javascript - React-router <NavLink> component doesn't get active after click on it -
here's code of component use <navlink>
react-router-dom
library. after click on , url changes once specified in to
prop styles specify in activestyle
prop don't appear supposed to.
import react, { component } 'react' import { navlink } 'react-router-dom' import styles './../../styles/components/listlabel.css' class listlabel extends component { render() { const { name, id } = this.props return ( <navlink to={`/list/${id}`} style={{ textdecoration: 'none', color: 'inherit' }} activestyle={{ fontweight: 'bold' }} > <div classname={styles['list-label']}> <div classname={styles['name']}> {this.props.name} </div> <i classname={styles['settings-button']} /> </div> </navlink> ) } } export default listlabel
here's route:
<content> <route path="/list/:listid" component={listcontent} /> </content>
what wrong?
Comments
Post a Comment