I'm currently working on a React web application that relies heavily on inline styling.
My goal is to ensure compatibility with the latest versions of major browsers (Safari, Chrome, Firefox, IE) while utilizing flexbox for layout.
The issue I encountered is that the current style variable doesn't function properly across all browsers:
var ContainerStyle = {
display: 'flex',
flexDirection: 'row',
flex: '1 1 auto',
backgroundColor: '#EFEFEF',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center'
};
I believe I need to include additional properties to address this problem:
{
display: '-webkit-flex',
display: '-moz-flex',
display: '-ms-flex',
display: '-o-flex',
display: 'flex',
-webkit-flex-direction: 'row',
-moz-flex-direction: 'row',
-ms-flex-direction: 'row',
-o-flex-direction: 'row',
flex-direction: 'row'
}
However, manually implementing these changes everywhere seems like a daunting task. Are there any polyfills available to simplify this process? Or perhaps a tool that can transpile the code automatically?
Thank you in advance!