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
jakehm
@jakehm
and you can inject as many reducers as you want. Just change the key.
joshuaandrewhoffman
@joshuaandrewhoffman
@jakehm so there's no actual dependency created between the store name and the reducer name? In the examples they're the same so I assumed some plumbing/magic was happening somewhere I hadn't found yet. As I'm typing it though that magic sounds inconsistent with my understanding of how reducers work in redux 😅 so I think maybe I get why the key change would work.
Thanks a ton for the input on this! I'm glad I decided to do this refactor, I'm learning a lot of stuff I missed or didn't fully grok
Nilay Kothari
@kotharinilay
hey all,
I am new to redux, just wanted to ask what data should store in redux store?
Is it good to store form data in redux store?
How often should I connect to store to update data (i.e. is it fine to update store data on text field change event?), which don't affect performance?
help me to get it started..
jakehm
@jakehm
@kotharinilay it does affect performance but you can do it. If you don't need to update the state every time the user types a new letter, I would use refs to only update state on submit
jakehm
@jakehm
If you are asking about putting the value in the store vs state, I think the performance is the same.
jakehm
@jakehm
When I save changes to components, there's no reload, but when I make changes to stuff that isn't as deep, like routes, reload does work. Anyone know what's going on?
jakehm
@jakehm
i did yarn clean, which is the script for rifram and it kind of broke everything
jakehm
@jakehm
also are there any plans to move to rr 4 soon? I think I need it for my hmr to work.
bytewiz
@bytewiz
@kotharinilay both your questions very much depend on what you are trying to do. Do you have some use case or example?
Sanjin Šarić
@sanjin-saric

Hi guys. I would like to import a stylesheet that would be local and NOT loaded from cdn, how do I do that?

For example how would I add bootstrap.sass (from node modules) to be loaded locally.

Terry Raimondo
@terry90
Hey, is there something simpler than Counter/index.js to declare the component ? Why is it important to do it async ? I'm kinda new to React and Redux so I do not want to add more noise to my brain, already much things to learn. The thing is I don't understand require.ensure([], (require) => :heart:
mrweissx
@mrweissx_twitter
@terry90 this is to support webpack code splitting (https://webpack.github.io/docs/code-splitting.html)
@terry90 so instead of your entire app existing in 1 large .js file, you can split separate routes into separate files that are loaded on demand
Félix Bayart
@yukulelix
Hi guys ! I wanted your advices on what would be the best strategy to implement a first async fetch when loading a new route.
As the components should remain purely functional, I guess adding a componentDidMount isn't the right way to go ??
VisionCptn
@VisionCptn
Hello guys, sry foe noobie question, but is this starter kit isomorphic.
Roman Pearah
@neverfox
@yukulelix You might consider responding to a LOCATION_CHANGE action using react-router-redux and redux-saga.
VisionCptn
@VisionCptn
can smb tell me what is path from index.html to npm folder.
Zenthon
@huangzhuolin
I was confused that why use [COUNTER_INCREMENT] instead of COUNTER_INCREMENT in the boiler code. Who can give me some tips?
// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [COUNTER_INCREMENT]    : (state, action) => state + action.payload,
  [COUNTER_DOUBLE_ASYNC] : (state, action) => state * 2
}
Preston Manning Bernstein
@prestonbernstein
Hey everyone
I would like to submit a pull request to this projecty
A simple update to the README to clarify the current Developer Tools implementation
How could I go about getting authorization to contribute to this repo? Thanks so much
Ernesto Palafox
@palafoxernesto
Hi everybody!
I'm almost new in the react-redux world, i found this starter and it seems perfect to me to start a project.
Right now I am wondering how should i handle JWT authentication. Can anyone give some advice? Thank you
Preston Manning Bernstein
@prestonbernstein

Hey everyone,

I went ahead and updated the tutorial for the current version of react-redux-starter-kit. You can check it out here

Ernesto Palafox
@palafoxernesto
Didn't know about this tutorial, thank you @prestonbernstein its very useful!
Preston Manning Bernstein
@prestonbernstein
Thanks @palafoxernesto . I have to give a shout out to Markus, who wrote the first iteration of this article. I hope that it helps you out in your coding!
Daniel Winter
@lucidlemon
hi guys
any preferred method on how to update my app with the latest version of this kit?
like i started my app 6 months ago using this package, now i'd want to update
Preston Manning Bernstein
@prestonbernstein

Hey everyone.

Could someone take a look at my pull request when they get a chance? Without this file, npm test will error out on my machine, as well as on my CircleCI build.

davezuko/react-redux-starter-kit#1141

Thanks!

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.