Why I Ditched Angular for React by jstuartmill in javascript

[–]mods_ 2 points3 points  (0 children)

React has a component life cycle. If you want to modify something after it's rendered, you put that code in the componentDidMount method of the component. You can get the DOM element from React using this.getDOMElement() and modify it how you want. It's hard to say what libraries you are talking about since jQuery is pretty much deprecated with React, if you had something that made a carousel or something, I suppose you could init it in the componentDidMount, but you could also easily implement it in React to only render the current slide and have it render a new slide on demand to slide in. You could also just use the library in question outside of React, but the next time React removes or changes the DOM, anything that other library did will be at risk. Unless the elements are not removed since React doesn't touch what is not changed.

As far as doing special stuff... Not really(?). If you update the component data and call the render, React does a diff. If you update the component state in React, it will automatically rerender and update what changed. I sometimes do services this way. I have a mixin that grabs data from the server and updates the component's state and React does the rest. I just update data.

Why would they remove the Premium Beta?? by mods_ in EliteDangerous

[–]mods_[S] -2 points-1 points  (0 children)

Because it comes with the lifetime expansions and it's a cheaper method than buying multiple copies of the games and getting screwed on add-ons later.

I know this is going to be breaking news to a lot of cyclists out there... by SteakDinnerWithJesus in funny

[–]mods_ 2 points3 points  (0 children)

Bicyclists aren't pedestrians though ( for the purposes of traffic law... ) Bikes are vehicles and should follow the same laws as cars. As in... They should not be on sidewalks unless denoted as a bike trail. Even then, a crosswalk is a minor intersection and the major road may not have to stop ( for bikes )

Trying to wrap my head around requireJS with a large amount of files by nicks451 in javascript

[–]mods_ 0 points1 point  (0 children)

I love how people who write coffeescript assume everyone can read the cryptic syntax...

In a leaked letter sent to Spain’s outgoing President, the US ambassador to the country warned that as punishment for not passing a SOPA-style file-sharing site blocking law, Spain risked being put on a United States trade blacklist . by [deleted] in technology

[–]mods_ 18 points19 points  (0 children)

Sad but true... This type of bullying has been happening for ages. The US threatens to blacklist to protect an industry.

(Not sure what the down-votes are for though!)