Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 10 2018 02:41
    Naiba01 commented #1157
  • Sep 05 2018 18:37
    govarthananve commented #1080
  • Sep 05 2018 17:12
    carloquilala opened #1349
  • Aug 07 2018 11:42
    carloquilala edited #1348
  • Aug 07 2018 11:14
    carloquilala opened #1348
  • Jul 31 2018 06:46
    zaoansijia commented #1347
  • Jul 13 2018 01:45
    gapsaras commented #842
  • Jul 12 2018 10:08
    grootendorste commented #930
  • Jul 02 2018 15:06
    aozfen commented #1092
  • Jun 25 2018 17:25
    olliecaine27 closed #1268
  • Jun 03 2018 17:30
    olliecaine27 synchronize #1268
  • Jun 03 2018 17:16
    olliecaine27 synchronize #1268
  • May 22 2018 05:14
    ishan123456789 commented #1220
  • May 19 2018 08:38
    MirShi opened #1347
  • May 14 2018 19:53
    samanthi22 closed #1346
  • May 14 2018 19:53
    samanthi22 commented #1346
  • May 05 2018 17:33
    samanthi22 opened #1346
  • Apr 22 2018 09:28
    m-ketan closed #1319
  • Apr 20 2018 00:40
    matthew-dean commented #658
  • Apr 02 2018 12:36
    AndrewSavetchuk commented #1080
aditya shanker tagirisa
@adityashankert
hi i want to maintain global authentication data state and fetch the auth data from backend whenever page is refreshed can anyone help me with how to do this
?
is there anyway i can call the dispatch of other route from route of one index.js
James Pearson
@jamespearson
Hello Everyone. Does anyone have a good example of how to do child routes, like "/categories/" and "/categories/:id/" ?
Nilay Kothari
@kotharinilay
hi, I am using isomorphic approach for my react-redux application, I want to retain my previous redux store data on refresh.
but, as it load from server I am not able to get previous store data.
Is there any way to get previous redux store data on server side, so that I can set it as my initial state?
jsolin
@jsolin
@amergin Hi, I saw your npm error: https://gist.github.com/amergin/4454006f8b3b87c3ef62a75a79d8e165 and I sit with the same problem right now, do you know how to solve?
Shawn Mclean
@shawnmclean
Hey guys, maybe I missed it, how can I configure this project to run without a server? I Just want to use it like an SPA static site.
Roman Pearah
@neverfox
It's already like that.
The included server is a dev server.
Shawn Mclean
@shawnmclean
OH, ok, thanks.
Roman Pearah
@neverfox
Yep, just build and take the static dist.
Shawn Mclean
@shawnmclean
Should I use the npm run deploy:prod command to double as both test and deploy in the CI?
Roman Pearah
@neverfox
@shawnmclean That seems right, but it should be a simple matter to customize those scripts to your needs.
Shawn Mclean
@shawnmclean
This might not be specific to the starter kit, how would I go about designing a website that contains 2 separate apps loaded at different URLs like /app1 and /app2 that load its own styles and scripts. (One app may be very large). Is this 2 separate .html files or can I do this elsewhere like a Container or Layout?
Carl Welch
@carlwelchdesign
I've been having a hard time loading json data into the store before render. It works fine in DEV, but when I run deploy:prod and push to a server, only the indexRoute loads - ChildRoutes are 404 or missing their data
This is what I have currently:
import React, { Component, PropTypes } from 'react'
import { browserHistory, Router } from 'react-router'
import { Provider } from 'react-redux'

class AppContainer extends Component {
  static propTypes = {
    routes : PropTypes.object.isRequired,
    store  : PropTypes.object.isRequired
  }

  componentWillMount(){
      const { routes, store } = this.props
      store.dispatch({type: 'GET_JSON_DATA'})
  }

  shouldComponentUpdate () {
    return true
  }

  render () {
    const { routes, store } = this.props

    return (
      <Provider store={store}>
        <div style={{ height: '100%' }}>
          <Router history={browserHistory} children={routes}/>
        </div>
      </Provider>
    )
  }
}

export default AppContainer
Carl Welch
@carlwelchdesign
how do you register a call back to let componentWillMount() know that all your data has been loaded into the store?
Carl Welch
@carlwelchdesign

I ended up doing this. Seems to work:

import React, { Component, PropTypes } from 'react'
import { browserHistory, Router } from 'react-router'
import { Provider } from 'react-redux'

class AppContainer extends Component {
    static propTypes = {
        routes : PropTypes.object.isRequired,
        store  : PropTypes.object.isRequired,
        loaded : PropTypes.bool.isRequired,
    }

    constructor() {
        super()
        this.state = {loaded : false}
    }

    componentWillMount = (nextState, replace, callback) => {
        const { routes, store } = this.props
        store.dispatch({type: 'GET_JSON_DATA', cb: this}) <--- include 'this' so I can call isLoaded() from my data-service actions
    }

    isLoaded(){
        console.log('isLoaded')
        this.setState({loaded: true})
    }

    shouldComponentUpdate () {
        return true
    }

    render () {
        const { routes, store } = this.props
        if(this.state.loaded){
            return (
                <Provider store={store}>
                    <div style={{ height: '100%' }}>
                        <Router history={browserHistory} children={routes}/>
                    </div>
                </Provider>
            )
        }else{
            return <div></div>
        }
    }
}

export default AppContainer

and in my data-service actions:

....
return axios.all([getPosts(), getPages(),getJobs()])
                .then(axios.spread(function (posts, pages, jobs) {
                    console.log('STORE LOADED')
                    action.cb.isLoaded() <-- I call the function isLoaded() in AppContainer.js
                }));
...
Shawn Mclean
@shawnmclean
Whats the recommended practice for runtime configurations? ie. variables that may differ per environment.
Roman Pearah
@neverfox
@shawnmclean I would recommend following the 12-factor app recommendation, i.e. use a single set of environment variables. You can set them up using config/project.config.js.
Tummala Dhanvi (c0mrad3)
@dhanvi
I am trying to create a simple front end application with react-redux-starter-kit , any resources would be welcome
Roman Pearah
@neverfox
@dhanvi That's a rather broad call for help.
Kostas Bariotis
@kbariotis
Hello everyone!
I would like to ask how would you connect a store to the Header component
What's the preferred method and why?
Roman Pearah
@neverfox
@kbariotis As with any component you want to make "smart," use react-redux's connect.
Kostas Bariotis
@kbariotis
@neverfox Thank you for replying
I haven't actually make it and im working on it for a few hours
This message was deleted
Kostas Bariotis
@kbariotis
Here's what I am trying to do
I have two routes the / and the /cart
the / route sets a home key to the global store
the /cart route sets a cart key to the global store
I have connect the Header component like you said that tries to read from the cart key of the state
but when someone lands into / there is no cart key there just yet
hows would you go about this?
I thought I would inject another reducer that would support the Header component thats why I am trying to access the store there
Creg Bradley
@creg
Quick Q: I want to define some sass constants that can be consumed in the other modules in the project. I've tried defining them in core.scss and _base.scss but I get an undefined variable error when I try to reference them. Any idea what I'm doing wrong?
Ryan Garant
@protoEvangelion
Does react-redux-starter-kit come with server side rendering built in?
Roman Pearah
@neverfox

@protoEvangelion No, this particular kit is for pure client-side development. From the README:

This project does not concern itself with the details of server-side rendering or API structure, since that demands an opinionated structure that makes it difficult to extend the starter kit.

kmeilgaard
@kmeilgaard
Hi! I was looking at the tests written for the starter kit, I'm new to testing and I was wandering why there were no tests for Container components like CounterContainer
Krisztian Balla
@successkrisz
@davezuko is anyone working on introducing webpack 2 to the project now, or is it something you'd consider adding to the project? If not I'm happy to start out on it.
@kbariotis if you depend on reducers regardless of route, then declare it on store creation, no need to load it async, then it will be available straight away
Krisztian Balla
@successkrisz
@carlwelchdesign Just an idea, I'd dispatch the action to load the initial data in main.js right after the store is created, and connect the CoreLayout to the store, than render a spinner in there if data is not available (even better: render a spinner only if it takes more than 200ms). As with an external store there's no need to worry about lifecycle hooks etc.. I believe it looks cleaner as well
@kmeilgaard container components mainly deal with side-effects, as glue between the store and components (in most cases) there's no point testing them in most cases. Like testing connect() belongs to the react-redux package really. in most react/redux applications most of the logic lives in action-creators, that's why most of the tests address that.
Krisztian Balla
@successkrisz
@creg You need to import them the file you define your constants in to the file you want to use them, otherwise sass-loader converts them individually and the variables wouldn't be defined in scope.
VisionCptn
@VisionCptn
Hello guys, can smb give link for real projects using this starter kit ?
appreciate
Roman Pearah
@neverfox
I admit that I really don't understand requests about real project examples, given that the starter kit pieces itself work pretty much the same in any size project (with the possible exception of some CSS things here and there), with all the added complexity coming from whatever you end up doing with React/Redux. In fact, if the kit is doing what it's supposed to be doing, you clone it, dive into the src folder and starting writing components. So really any sufficiently complex React/Redux example from anywhere should do, if that's what you need to examples of.
I mean, is there a specific aspect of the kit itself that is making it hard to figure out how to get started?
Not to say that I wouldn't happily link to one, but I imagine that most are like mine: proprietary work projects.