Comments (3)
👍 Thanks for reporting. This will be patched in an upcoming release.
from redux-ui.
Hot updates seem to work fine if you don't pass the key to the decorators. Not sure if there are other conditions.
Using:
"react": "^15.5.4",
"redux": "^3.6.0",
"redux-ui": "^0.1.1",
"react-hot-loader": "^3.0.0-beta.7",
"react-css-modules": "^4.1.0",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.4.2",
webpack.NamedModulesPlugin()
from redux-ui.
Same issue with HMR. This is an example of how I'm using redux-ui.
import React, { Component } from "react"
import { bindActionCreators } from "redux"
import { connect } from "react-redux"
import ui from "redux-ui"
import * as reduxActions from "../actions/todos"
import TodoList from "../components/TodoList"
import { createSelector } from "reselect"
import { loadingReducer } from "../reducers/todos"
import { SHOW_ALL, SHOW_COMPLETE, SHOW_INCOMPLETE } from "../constants"
export class TodoListContainer extends Component {
componentDidMount = () => this.props.fetchTodos()
render = () =>
this.props.ui.isLoading
? <p>Loading initial todos from server ... </p>
: <TodoList {...this.props} />
}
export const mapStateToProps = state => ({
todos: filteredTodosSelector(state),
filter: state.data.todoList.filter,
isLoading: state.data.todoList.isLoading
})
export const mapDispatchToProps = dispatch => bindActionCreators(reduxActions, dispatch)
const uiConfig = {
key: "todoList",
state: { filter: SHOW_ALL, isLoading: false },
reducer: loadingReducer
}
export default ui(uiConfig)(connect(mapStateToProps, mapDispatchToProps)(TodoListContainer))
export const filteredTodosSelector = createSelector(
[state => state.data.todoList, state => state.ui.get("todoList").get("filter")],
(todos, filter) => {
switch (filter) {
case SHOW_ALL:
return todos
case SHOW_COMPLETE:
return todos.filter(item => item.get("complete"))
case SHOW_INCOMPLETE:
return todos.filter(item => !item.get("complete"))
default:
return todos
}
}
)
from redux-ui.
Related Issues (20)
- Exception thrown after @@redux-ui/MOUNT_UI_STATE HOT 1
- How to preserve ui state after remount. HOT 2
- Where and how to update UI state for thunks? HOT 3
- What are your thoughts on normalizr vs falcor? HOT 1
- redux-ui with redial HOT 1
- Beware, ReduxUI force update child / Inner component, bad for performance !
- persist ui state HOT 1
- enhancement: allow key to be a function
- No example on how to use `updateUI`, consider adding one HOT 3
- Issue with PropTypes in >= React 15.5.0 HOT 1
- Last version is published by yarn HOT 2
- .babelrc should be ignore in package.json HOT 1
- The reducer in options depends on the order of component
- TypeError: state.get is not a function HOT 1
- react, react-redux and redux should be expressed as 'peerDependencies' in package.json HOT 1
- Cannot specify sub HOC components to use their own key off of UI
- Setting up library do we need to initialize ui prop? HOT 3
- Is this Repository active? HOT 21
- Callbacks?
- react-redux v6 - Uncaught Invariant Violation: Could not find "store" in either the context HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-ui.