Предположим, компонент будет называться LikeButton
src/
components/
LikeButton.jsx
Если придерживаться правила "как компонент называется, с таким же именем создаем файл", будет проще находить нужный файл.
export const LikeButton = () => {
return ()
}
export const LikeButton = () => {
return (
<div>
<button>Press me</button>
</div>
)
}
export const LikeButton = ({
text = "Press me",
onClick = () => null,
}) => {
return (
<div>
<button onClick={ onClick }>{ text }</button>
</div>
)
}
.wrapper {
/* свойства кнопки тут */
}
import classes from './LikeButton.modules.css'
export const LikeButton = ({
text = "Press me",
onClick = () => null,
}) => {
return (
<div className={classes.wrapper}>
<button onClick={ onClick }>{ text }</button>
</div>
)
}