React Newline to break (nl2br)
Because you know that everything in React is functions, you can’t really do this
1 | this.state.text.replace(/(?:\r\n|\r|\n)/g, '<br />') |
Since that would return a stri 继续>
Blog of ZCW 亦·德利菲的小窝
Because you know that everything in React is functions, you can’t really do this
1 | this.state.text.replace(/(?:\r\n|\r|\n)/g, '<br />') |
Since that would return a stri 继续>
In React, one of the first big issues that comes up is figuring out how components should communicate with each other. What's the best way to 继续>
1 2 3 4 | var done = function(response) { console.log('response', response) } var fail = function(error) { console.log('error', error) } var always = function() { console.log('always') } Promise.resolve(42).then(done).catch(fail).then(always, always) |
from:https://github.com/github/fetch/issues/223#issuecomment-148927226