-1

I want to hide the yellow title when focus on input but I cant pass it from the component to use it in index page https://codesandbox.io/s/focus-insi7

karma
  • 1
  • You cannot pass props from child component to parent in react – Viet Aug 14 '21 at 02:47
  • Does this answer your question: [How to pass data from child component to its parent in ReactJS?](https://stackoverflow.com/a/60315004/1870780)? – juliomalves Aug 14 '21 at 09:46

1 Answers1

0

Try using plain CSS.

For example, if you have something like this:

<div>
  <input />
  <span/>
</div>

and wanted to affect the span element when the input is focussed, you can do:

input:focus + span {
  // Whatever styles you want to be applied to the span
}
francis
  • 3,852
  • 1
  • 28
  • 30