reactjs-flux

React/Flux and xhr/routing/caching

…衆ロ難τιáo~ 提交于 2019-11-30 22:55:52
问题 This is more of a "whats your opinion/Am I correct in thinking this?" question. Trying to be as strict as possible while understanding Flux, I was trying to figure out where XHR calls are made, websockets/external stimuli handled, routing takes places, etc. From what I read across articles, interviews and looking through facebook examples there are a few ways of handling these things. Following flux strictly, Action creators are the ones that do all the XHR calls with the possibility of a

React Native Android: Static Image is not showing in production released apk

霸气de小男生 提交于 2019-11-30 14:03:42
I have static image in my react-native app accessing via <Image source={require("../assets/preview-full-img-title-logo@2x.png")} /> in development it is showing well but in production release APK is not showing what can be the reason? I have followed steps mention here. https://facebook.github.io/react-native/docs/signed-apk-android.html Waleed Arshad This is the command that did it for me: react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/ take a look at

Stores' change listeners not getting removed on componentWillUnmount?

岁酱吖の 提交于 2019-11-30 13:03:16
问题 I am coding a simple app on reactjs-flux and everything works fine except I am receiving a warning from reactjs telling me that I am calling setState on unmounted components. I have figured out this is because changelisteners to which components are hooked are not being removed from the store on componentWillUnmount . I know it because when I print the list of listeners from Eventemitter I see the listener which was supposed to be destroyed still there, and the list grows larger as I mount

Why use one store per entity in the flux application architecture?

江枫思渺然 提交于 2019-11-30 12:43:28
I am using reactjs and the flux architecture in a project I'm working on. I am a bit puzzled by how to break up nested data correctly into stores and why I should split up my data into multiple stores. To explain the problem I'll use this example: Imagine a Todo application where you have Projects. Each project has tasks and each task can have notes. The application uses a REST api to retrieve the data, returning the following response: { projects: [ { id: 1, name: "Action Required", tasks: [ { id: 1, name: "Go grocery shopping", notes: [ { id: 1, name: "Check shop 1" }, { id: 2, name: "Also

ReactJS Flux Application directory structure

点点圈 提交于 2019-11-30 11:37:36
问题 My team is currently working on a large application being written in ReactJS using Facebook's Flux architecture. It is still in its infancy right now but it is going to grow big very soon. It will have more than 50 small component views, plenty of actions, stores and action-creators. Currently, our directory structure looks like - App |___ module_1 | |___ components | | |___ component1.react.js | | |___ component2.react.js | |___ module1ActionCreators.js | |___ module1Constants.js | |___

What are differences between redux, react-redux, redux-thunk?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 10:13:59
问题 I am using React + Flux. Our team is planning to move from flux to redux. Redux is very confusing for me coming from flux world. In flux control flow is simple from Components -> actions -> Store and store updates back components . Its simple and very clear. But in redux its confusing. There is no store here, yes there are some examples without using store. I went through several tutorials, it seems everyone has their own style of implementation. Some are using Containers and some are not. (I

is there any good Http library for React flux architecture

浪尽此生 提交于 2019-11-30 08:27:16
We have a react application with Flux architecture, I am searching any good library for sending http request like angular's $http, $resources. You don't need something specific for React or Flux, you can use a regular CommonJS module. There are several you can use, my favourites are: Superagent : small, easy to use and easily extensible via plugins Axios : really nice implementation of the Promise API and Client side support for protecting against XSRF (plus supports IE8) Fetch : built by Github so support is pretty good All the links include installation and usage Yes you can use the whatwg

flux multiple store instances

*爱你&永不变心* 提交于 2019-11-30 06:57:28
In a flux application where data is divided into buckets by owner id, should we use one store which internally separates the data into buckets, or one store instance per bucket? For instance, we have an application user who is a coach for multiple athletes. Each coached athlete has zero or more workouts, and the coach can view one or more athletes' workouts at the same time. We could have one workout store for all athletes; the store has to ensure that all data is separated into athlete buckets, and every store method requires an athleteId parameter. Or, we could have one store instance per

Stores' change listeners not getting removed on componentWillUnmount?

会有一股神秘感。 提交于 2019-11-30 05:37:02
I am coding a simple app on reactjs-flux and everything works fine except I am receiving a warning from reactjs telling me that I am calling setState on unmounted components. I have figured out this is because changelisteners to which components are hooked are not being removed from the store on componentWillUnmount . I know it because when I print the list of listeners from Eventemitter I see the listener which was supposed to be destroyed still there, and the list grows larger as I mount/unmount the same component several times. I paste code from my BaseStore: import Constants from '../core

ReactJS findDOMNode and getDOMNode are not functions

点点圈 提交于 2019-11-30 04:12:11
I'm building a web-app with ReactJS and Flux and I'm trying to get the node of my current div using the method findDOMNode and I get the next error: Uncaught TypeError: React.findDOMNode is not a function So, I tried to use getDOMNode and I get the very same error: Uncaught TypeError: React.getDOMNode is not a function I'm using npm to build the JS, the code where I use these methods: var React = require('react'); var stores = require('../stores'); var MessagesUserContainer = require('./messageusercontainer'); var ChatStore = stores.ChatStore; var owner = stores.getOwner(); var MessagesList =