import React from 'react'
const CustomButton = ({ type, title, customStyles, handleClick }) => {
return (
<button
className={'px-2 py-1.2 flex-1 rounded-md ${customStyles}'}
>
{title}
</button>
)
}
export default CustomButton
The customStyles keeps saying it’s declared but not being read. The customStyles is not being applied to the site, but everything else is. I don’t know what the problem is.
2
Answers
Template literals are enclosed by the back-tick instead of single or double quotes.
use
className={`px-2 py-1.2 flex-1 rounded-md ${customStyles}`}
className
attribute.(``)
instead of single quotes('')
around the whole string.