You would like to change the size attribute as the text changes. Your code works great but I have a problem. this should be the accepted answer. Can FOSS software licenses (e.g. In React, all DOM properties and attributes (including event handlers) should be camelCased. How do I get the value of text input field using JavaScript? The update function needs to be edited. after installing React 18 types make sure to only have a single version of @types/react installed. Depending on the kind of element being changed and the way the user interacts with the element, the change event fires at a different moment: The HTML specification lists the types that should fire the change event. It only works one level deep, and is intended to be used as an escape hatch. It's not easy to assume it is a mono-sized font. You could use the CSS-Unit "ch" (characters) which represents the width of the character "0" in the chosen font. Prism.js works a lot better when the source code is wrapped in a typical
 tag comboits only missing the editable part of the equation. defaultChecked is the uncontrolled equivalent, which sets whether the component is checked when it is first mounted. width, height, padding, margin, border-width, outline and box-sizing in