Browser | App URL | Ajax URL | Works? | Reason |
---|---|---|---|---|
IE 11 | http://localhost:9000 | http://localhost:9001 | Yes | Port number is ignored by IE |
Chrome | http://localhost:9000 | http://localhost:9001 | No | different origin and doesn't handle 401 and make popup |
IE 11 | http://127.0.0.1:9000 | http://localhost:9001 | No | IE block cross origin calls |
Chrome | http://127.0.0.1:9000 | http://localhost:9001 | No | different origin and doesn't handle 401 |
In React always treat component props and state as immutable. props are owned by parent component and flow one-way from parent to child. State is private to the current component and can only be changed by setState. When there is need to flow data from child to parent, use the event handler.
- Don't try to access children component's state using refs.
For example (bad code)
this.refs.myChildComp.state
Usually when you want to add a event handler to a dynamically loaded UI compoent is to wait for the UI is generated and then attached the event handler. If this is the only way to do it, and if you are writing a shared library, you have to provide a "update"/"refresh" function to run to attach the event handlers in the "wait" function.
$.when($.ajax(url)).done(function(result){
$('<div>').appendTo(myDoc).click(function(){
......
});
});
- Use "Blackbox" script to skip library files
- Use "window.onerror" to report client error back to server.
- Ctrl+r to reload the page in debugger.
- Ctrl+o to search file by name
npm install -g npm
NPM Scripts run command using binary from the packages in the current location and doesn't use the globally installed package. When using NPM scripts to run build commands, it is not necessary to install build package globally.
npm list --depth=0
A line by line comparison of Redux and Alt's implementation of Dan Abramov's Todo list example
Redux is getting hot! The trend can be seen from this Redex vs Alt NPM trend chart. However the framework of Alt + AltContainer is a much more concise and much easier to understand than Redux.
It seems Alt is not getting as much attention as Redux. There may be a few reasons for this. First, the best coding approach of Alt + AltContainer is not well documented. Second, even though Alt came out earlier than Redux but AltContainer is a few months later than Redux. Third, Dan Abramov the author of both React Hot Loader and Redux is a better known figure.
If you haven't heard of Alt, please read along and see why I think Alt is much easier than Redux. This is a line by line comparison of Dan Abramove's Todo list demo for Redux and my porting of the Todo list to Alt implementation.
To run the [sample code from Github](https://github.com/eth