React v0.12
21–30 of 79 posts
Re: React v0.12
#22I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.
Hi, this was a tough call for us to make. We wanted to everything we could to avoid extra bloat for everyone. In the end, most people tend to use some kind of extra helper, even if it's not JSX. E.g. a custom library or another third party language. One reason for this change is to make it possible to use object literals or record syntax where that is more appropriate than function calls. We don't currently recommend…
Could you give me a quick example of calling a component with object literals instead of functions? I'm not understanding how that will play out in the final code.
Also, isn't it just adding React.createFactory, not replacing React.createClass?
Re: React v0.12
#23I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.
Hi, this was a tough call for us to make. We wanted to everything we could to avoid extra bloat for everyone. In the end, most people tend to use some kind of extra helper, even if it's not JSX. E.g. a custom library or another third party language. One reason for this change is to make it possible to use object literals or record syntax where that is more appropriate than function calls. We don't currently recommend…
I can't decode what "Composite Component functions can no longer be called directly" means exactly in terms of code that will no longer work.
I definitely use React without JSX in plain JavaScript and I really love it. I'm kind of dreading what this little snippet means when I try to update to 0.13.
Re: React v0.12
#24Earlier quoted context omitted.
Hi, this was a tough call for us to make. We wanted to everything we could to avoid extra bloat for everyone. In the end, most people tend to use some kind of extra helper, even if it's not JSX. E.g. a custom library or another third party language. One reason for this change is to make it possible to use object literals or record syntax where that is more appropriate than function calls. We don't currently recommend…
Thanks for the response. Could you give me a quick example of calling a component with object literals instead of functions? I'm not understanding how that will play out in the final code. Also, isn't it just adding React.createFactory, not replacing React.createClass?
element = type: 'div' props: className: 'container', children: [ type: 'span', props: className: 'foo' type: CustomClass, props: className: 'bar' ]
(This doesn't fully work in 0.12 because we also have some extra properties on there but that's the direction we're going.)
0.12 is just adding React.createFactory. 0.13 will optionally replace React.createClass.
We do this so that there's a seamless upgrade path. We have to remove the warnings to fix the classes.
Re: React v0.12
#25I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.
It still doesn't solve the stuff JSX has for splats though ...
[1]: https://gist.github.com/mikew/e737273e42ed704c6c54#file-zz-r...
Re: React v0.12
#26Re: React v0.12
#27Can someone explain what the "spread operator" is and how to use it?
https://gist.github.com/sebmarkbage/07bbe37bc42b6d4aef81
var component = ;
Wha?? For me, there's a point in a language where the benefits of syntactic sugar are outweighed by readability concerns.Re: React v0.12
#28Re: React v0.12
#29But well, the developers were there and, you know, they cannot see a repository without commits for much time, right?
Re: React v0.12
#30Earlier quoted context omitted.
Thanks for the response. Could you give me a quick example of calling a component with object literals instead of functions? I'm not understanding how that will play out in the final code. Also, isn't it just adding React.createFactory, not replacing React.createClass?
In CoffeeScript it might look something like this: element = type: 'div' props: className: 'container', children: [ type: 'span', props: className: 'foo' type: CustomClass, props: className: 'bar' ] (This doesn't fully work in 0.12 because we also have some extra properties on there but that's the direction we're going.) 0.12 is just adding React.createFactory. 0.13 will optionally replace React.createClass. We do th…
element =
type: 'div'
props: className: 'container'
children: [
type: 'span'
props: className: 'foo'
,
type: CustomClass
props: className: 'bar'
]