Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Getting Started with React

You're reading from  Getting Started with React

Product type Book
Published in Apr 2016
Publisher
ISBN-13 9781783550579
Pages 212 pages
Edition 1st Edition
Languages
Authors (3):
Doel Sengupta Doel Sengupta
Profile icon Doel Sengupta
Manu Singhal Manu Singhal
Profile icon Manu Singhal
Danillo Corvalan Danillo Corvalan
Profile icon Danillo Corvalan
View More author details

Table of Contents (18) Chapters

Component properties


In the Chapter 2, Exploring JSX and ReactJS Anatomy, we talked a lot about ReactJS properties and used them throughout our examples, but so far, we've just used them like HTML properties. They play a role that is far beyond that. It's common to use them to pass data through your components tree that defines your view; to pass configuration properties that come from parent components; to pass callbacks for user input, UI/custom events that need to be triggered outside, and so on.

Properties of a ReactJS component can't be changed once the component is rendered in the DOM.

Properties define the declarative interface of the component. In a h1 element that renders a name property, for example, you can't change this name once it's rendered, unless you create another instance of the component and render it in the same place in the DOM, replacing the old rendered component.

var GreetingsComponent = React.createClass({
  render: function() {
    return (
      <h1>Hello...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}