0% found this document useful (3 votes)
2K views1 page

Props

This React component checks if a property called "hasSeat" is true or false, and conditionally renders either a <div> saying "Vacancy" if true, or "HouseFull" if false. The component is rendered on the page with "hasSeat" set to true, so it will display "Vacancy".

Uploaded by

Venkatesh Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (3 votes)
2K views1 page

Props

This React component checks if a property called "hasSeat" is true or false, and conditionally renders either a <div> saying "Vacancy" if true, or "HouseFull" if false. The component is rendered on the page with "hasSeat" set to true, so it will display "Vacancy".

Uploaded by

Venkatesh Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Housefull.

js
class HouseFull extends React.Component {
render() {
if(this.props.hasSeat) {
return(
<div>Vacancy</div>
);
} else {
return(
<div>HouseFull</div>);
}
}

export default HouseFull;

index.js
ReactDOM.render(<HouseFull hasSeat = '{true}'/>, document.getElementById('root'));

You might also like