Created
May 10, 2025 13:59
props simple example
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 './App.css' | |
function MyButton(props) { | |
return ( | |
<button style={{ backgroundColor: props.color }}> | |
Нажми меня | |
</button> | |
); | |
} | |
export class MyHeader extends React.Component { | |
render() { | |
return <h1>Hello</h1> | |
} | |
} | |
function App() { | |
return ( | |
<> | |
<MyButton color="red"/> | |
<MyHeader/> | |
</> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment