Last Updated: October 9, 2021

Previous tutorial we studied how to create React component. Now we will see how to add properties to the component

You can add dicount property to the Products component as shown in the below code and I have passed the value of discount as 10

import React from 'react'
import {render} from 'react-dom'
import {Products} from './products.js'




Now lets see how we can display the property value in product.js file

import React from 'react'

var createReactClass = require('create-react-class');
export const Products = createReactClass({

		return (
  • Product A
  • Product B
  • Product C
Discount {}

To display the value of property we added you can use the {}