## I don't know how to solve the bug....
This is my code:
import { connect } from 'react-redux'
import { setVisibilityFilter } from '../actions'
import { Link } from '../components/Link'
const mapStateToProps = (state, ownProps) => {
return {
active: ownProps.filter === state.visibilityFilter
}
}
const mapDispatchToProps = (dispatch, ownProps) => {
return {
onClick: () => {
dispatch(setVisibilityFilter(ownProps.filter))
}
}
}
const FilterLink = connect(
mapStateToProps,
mapDispatchToProps
)(Link)
export default FilterLink
Please use Stack Overflow for support questions. Github Issues are for the bugs in the library not your code.
Most likely this is the issue:
import { Link } from '../components/Link'
You are doing a _named import_.
This won’t work if Link has a _default export_.
If this is the problem, you can change the import to be the _default import_ (import Link rather than import { Link }).
@gaearon You are right!
Last night,I solved the problem!
I was so careless...
Thank you very much!
Most helpful comment
Most likely this is the issue:
You are doing a _named import_.
This won’t work if
Linkhas a _default export_.If this is the problem, you can change the import to be the _default import_ (
import Linkrather thanimport { Link }).