ryelle / Foxhound

A text-focused blog theme for WordPress (in React)
https://themes.redradar.net/foxhound
350 stars 39 forks source link

no menu appears #128

Open qurtopianodesign opened 6 years ago

qurtopianodesign commented 6 years ago

hi, I have a problem with the menu, I get an error in the console of this type: Uncaught TypeError: "Can not read property 'pathname' of undefined at Function.mapToProps",

the problem is in index.jsx export default connect( state => { const path = FoxhoundSettings.URL.path || '/'; const menu = getMenu( state, 'primary' ); return { currentPage: state.routing.locationBeforeTransitions.pathname || path, <------- here menu: menu || [], }; } )( Navigation );

what can I do to solve it?

thank you regards

JFernandoGomez commented 5 years ago

seems that react-router changed the way to access the pathname, @qurtopianodesign change locationBeforeTransitions.pathname to location.pathname it worked for me

check: https://github.com/reactjs/react-router-redux#how-do-i-access-router-state-in-a-container-component