I want to show hidden input fields when check “Buy on company” checkbox. It works, but if I uncheck it leaving “Is VAT exemt” checked and return: “VAT ID field” is shown with “Is VAT exemt” checkbox checked. So I want to avoid this situation. Picture of situation: Answer The code for clicking on buy_on_company is always hiding or showing
How to define React component with conditional props interface?
i need to define “Field” component that renders textarea or input depends on prop multiline I trying to do this like that: But typescript provide several errors like: Playground here How can i define such component? Answer Problem: No T in Field You have defined a generic type Props that depends on T but your component is not generic. It
How do I add the error message for BMI calculator fields next/under them instead of on the top of the page?
So I’m trying to get the error message to go next to the field, but I have no idea what I’m doing, I’m pretty new at this, sorry to bother you guys. Here’s the whole code: Answer To do it your way you would need a separate error message area next to each input, and each one would need a