Live data from Hacker News

React v0.12

facebook.github.io

1–10 of 79 posts

Re: React v0.12

#3
post #2

off topic a bit, but why do the CDN urls 301 redirect?

Do you mean the fb.me link, or did you see one of the fbcdn.net links redirect? If you mean the fb.me link, that's Facebook's URL shortening service, so those will always redirect (as far as I know).

Re: React v0.12

#5
I 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.

Re: React v0.12

#8
post #5

I 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.

Where did you see the increased difficulty if you weren't using JSX?

Re: React v0.12

#9
post #5

I 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.

You don't need to do a separate step to use JSX. JSX is a still a superset of JS and you can still opt to not use it with no additional steps.

Re: React v0.12

#10
post #6

Can someone explain what the "spread operator" is and how to use it?

Spread is like python's *args.

Instead of this:

  var mapArgs = function() {
    var args = Array.prototype.slice.call(arguments, 0, arguments.length - 1);
    var mapper = Array.prototype.slice.call(arguments, arguments.length - 1);
    return args.map(mapper);
  };
You can do this:

  var mapArgs = function(...args, mapper) {
    return args.map(mapper);
  };
And you can also use it to apply. Instead of:

  var max = Math.max.apply(null, [1, 2, 3, 4]);
You can do:

  var max = Math.max(...[1, 2, 3, 4]);
Post reply on HN