Skip to content
Advertisement

Tag: reactjs

What is the difference between state and props in React?

I was watching a Pluralsight course on React and the instructor stated that props should not be changed. I’m now reading an article (uberVU/react-guide) on props vs. state and it says Both props and state changes trigger a render update. Later in the article it says: Props (short for properties) are a Component’s configuration, its options if you may. They

how to render multiple children without JSX

How to write this without using JSX? This comes from the react.js tutorial: http://facebook.github.io/react/docs/tutorial.html I know I can do the following: But this only adds one element. How can I add more next to one another. Answer You can use the online Babel REPL (https://babeljs.io/repl/) as a quick way to convert little chunks of JSX […]

react.js: removing a component

I’m fairly new at react.js, so any help is greatly appreciated. I have this: https://jsfiddle.net/rzjyhf91/ Wherein I have made 2 components: an image and a button. The goal is to remove the image …

How to listen state changes in react.js?

What is the angular’s $watch function equivalent in React.js? I want to listen state changes and call a function like getSearchResults(). Answer I haven’t used Angular, but reading the link above, it seems that you’re trying to code for something that you don’t need to handle. You make changes to state in your React component hierarchy (via this.setState()) and React

Advertisement