Skip to content

Instantly share code, notes, and snippets.

@sunmeat
Created May 10, 2025 13:59
props simple example
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