I'm working on a project in React using create-react-app and trying to apply an inline style. Based on my research, the following line of code should work fine:
<div id="root" style={{ height: 'auto' }}></div>
However, when I run yarn start
, the HTML output is not as expected:
https://i.sstatic.net/GljtI.png
When I check the "edit html" option in Chrome, the code looks like this:
<div id="root" style="{{" height:="" 'auto'="" }}="">
I'm wondering why my {{ }}
are not functioning properly. Did I overlook something? Do I need to make additional configurations in webpack or babel for create-react-app?
It's worth noting that I have used eject
but have not made any changes to default settings that could impact this issue, as far as I am aware.