Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the recommended way to integrate with redux-simple-router #4

Closed
yakirn opened this issue Dec 27, 2015 · 5 comments
Closed

What is the recommended way to integrate with redux-simple-router #4

yakirn opened this issue Dec 27, 2015 · 5 comments

Comments

@yakirn
Copy link

yakirn commented Dec 27, 2015

I created a clean project using the generator.
then, npm install --save react-router redux-simple-router
but couldn't render components using Routes.
I changed run.js to render the routes:

<Provider store={store}>
    <Router history={history}>
      <Route path="/" component={App}>
        <IndexRoute component={SearchComponent}/>
      </Route>
    </Router>
  </Provider>

Modified reducers/index.js to combine the routeReducer:

import { combineReducers } from 'redux';
import { routeReducer } from 'redux-simple-router'
/* Populated by react-webpack-redux:reducer */
const reducers = { routing: routeReducer, search: require('../reducers/search.js') };

module.exports = combineReducers(reducers);

and added Router.RouteHandler to render under Main.js (AppComponent).
but I keep getting these two errors:

Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of AppComponent.

Uncaught Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of AppComponent.
Thanks in advanced

@weblogixx
Copy link
Member

Hi @yakirn,

react-router alone should work fine, I am also using it on some projects created with this generator.
Unfortunately, I am not a redux expert, so I will not be able to help you in this case. I am currently concentrating on alt.js only for this project.

However, there is another fork of this generator, https://github.com/stylesuxx/generator-react-webpack-redux. It comes with really nice Redux support out of the box. Usage is (mostly) the same.

If you plan to use Redux, I think you should use his generator instead.

Sorry that I could not help you more :(.

@yakirn
Copy link
Author

yakirn commented Dec 28, 2015

@weblogixx thanks for replying. I actually used that fork, and meant to post this issue there. (I dunno how I got in here, maybe accidently clicked the "forked form" link :/)
Anyway, it seems like the generator-react-webpack-redux fork doesn't conatin an issues section, and I dunno where else I can ask this question.
If you can somehow move this issue to that project or help me communicate with them in any other way, It would be great.
Thanks anyway, and sorry for the mistake :)

@weblogixx
Copy link
Member

@yakirn,

you are welcome and I think I get it now :). Seems like @stylesuxx has the issue tracking active in package.json, but disabled it on Github...

@stylesuxx: Mind to open die issue on your project?

@stylesuxx
Copy link

Oh, thanks for the hint, seems Issues are disabled by default when forking a project, I enabled the Issue section now.

@yakirn Maybe you could c/p the issue to my fork, so we can close it here and discuss it over there :-)

@yakirn
Copy link
Author

yakirn commented Dec 28, 2015

@stylesuxx Sure. done. stylesuxx#1

@yakirn yakirn closed this as completed Dec 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants