-
|
Hello, my name is Bo Kyung. When I handle the event on styled-component, I can see the target's value, id, etc.. Is this a problem with the react app or with the styled-component? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
@BOKYUNGGG Try to change |
Beta Was this translation helpful? Give feedback.
-
|
This is a React behavior, not a styled-components issue. Use styled-components forwards all event handlers and DOM props to the underlying element unchanged. |
Beta Was this translation helpful? Give feedback.
This is a React behavior, not a styled-components issue. Use
e.currentTargetinstead ofe.targetto get the element the handler is attached to.e.targetmay refer to a child element that received the actual click.styled-components forwards all event handlers and DOM props to the underlying element unchanged.