minimise the code since I am using the same code only the content in p tags changes and component AccordionHeader header changes

try to use just one static and pass the text that will be on the p tag as a parameter, so you don’t have a lot of functions there static accordion(ballInfo, content) { if (ballInfo.isRetrieving) { return ( <LoadingIndicator key=”foulLoading” /> ); } else if (ballInfo.error) { return ( <span className=”right-align negative”>Unavailable</span> ); } else … Read more

Redux Presentational Components Vs Container Component

You’ll find your components much easier to reuse and reason about if you divide them into two categories. I call them Container and Presentational components. I assume you have knowledge about redux architecture Container Components Aware of redux Subscribe redux state Dispatch to redux actions Generated by react-redux Focus on how things work Presentational Componets … Read more

having multiple instance of same reusable redux react components on the same page/route

You need to implement some way of namespacing the instances. This can be as basic as passing in a key to differentiate the components and reducers. You can use the ownProps in your mapStateToProps function to guide the mapping to a namespace const mapStateToProps = (state, ownProps) { let myState = state[ownProps.namespace] return { myState.value … Read more

Programmatically change Redux-Form Field value

You can have the onChange logic in this.handleSelectChange({ value, type: input.name }) and use change action from redux-form According to the docs: change(field:String, value:any) : Function Changes the value of a field in the Redux store. This is a bound action creator, so it returns nothing. Code: import { change } from “redux-form”; handleSelectChange = … Read more