Created
October 2, 2022 19:50
-
-
Save ProspektsMarch22/2c404124f794e51aad88e7b63953e43e to your computer and use it in GitHub Desktop.
React props used for changing UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Welcome } from './Welcome'; | |
class Home extends React.Component { | |
render() { | |
return <Welcome name='Ludwig van Beethoven' />; | |
} | |
} | |
ReactDOM.render( | |
<Home />, | |
document.getElementById('app') | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
export class Welcome extends React.Component { | |
render() { | |
if (this.props.name === 'Wolfgang Amadeus Mozart') { | |
return ( | |
<h2> | |
hello sir it is truly great to meet you here on the web | |
</h2> | |
); | |
} else { | |
return ( | |
<h2> | |
WELCOME "2" MY WEB SITE BABYYY!!!!! | |
</h2> | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment