I want to animate the background color in rgba for a modal so it fades in. I cant use opacity as the div inside the modal I dont want to be transparent. I cant use Jquery but I am using React.
I'm not getting an error by the below does not work
const modal = document.getElementById('modal');
modal.animate(
[
{backgroundColor: 'rgba(255, 0, 0, 0)'},
{backgroundColor: 'rgba(255, 0, 0, 0.8)'}
],
{duration: 200, easing: 'ease-in-out', fill: 'forwards'}
);