Closed michaeljonathanblack closed 7 years ago
@mherodev for 1. Have you tried wrapping that push in a redux-thunk dispatch?
eg.
export function navigateAbout() {
return (dispatch) => {
dispatch(push('/about'))
}
}
Blergh, of course! Sorry, it's been a minute since I've used Redux, just getting back into the swing of things. Thanks Ross.
I'm going to leave this issue open for now as a task for me to update documentation to reflect the smaller stuff like this for green Redux developers like myself.
Happy to help 👍
Yay, things were merged! Thanks again for the help and for the library 💃
Of course! Thanks for your patience 😄
Hey @tptee
Sorry for all of the posts! I am trying to get this library integrated with our app, but not having the best luck.
I believe I have everything hooked up correctly, although there is likely something I'm overlooking as the behavior I am seeing is weird or broken. For reference, here is my root component, App.js:
And here is what I am seeing:
/
loads correctly, the homepage is shown, and there are no errors in the console./about
sort of works. The contents of the AboutPage component load below the HomePage component. For some reason, HomePage is not unloaded./courses
does the same thing as with the AboutPage, but throws an error in the console for connectAdvanced.js?a26c:241/course
before/courses
does bad stuff. I assume I'm supposed to nest these co-matching routes in some way?--OH WAIT!
Okay, I figured out the route nesting after some trial and error. I wish the documentation around creating a series of Fragments was clearer, maybe I'll add a PR to clear that up. Here is what I landed on:
I only have one glaring issue right now, and one lesser issue that is likely just a bug in this framework or a product of how Redux DevTools handles things.
push
doesn't seem to do anything. I don't see an action in the RDT Inspector and the browser doesn't go anywhere. Do I need to mapDispatchToProps in some way? Here's the relevant code from my Course component:params
missing fromownProps.params.id
from my previous, React Router-based implementation. Why the error didn't point at the file and the line number, instead ofanonymous
andbundle.js
is something I need to figure out. Source mapping should be there.Mostly though I'm concerned about #1, if you can give me any insight! And sorry for the long post, it was largely a tool for me to work through my implementation, haha. Hopefully I'll get this all up and running and then I can get some PRs together for you that improve documentation for people like me 💃
Best Michael