Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
React JS - Proxy event?

I'm new in React and I'm using Semantic-ui-react. I'm trying to use the Dropdown.

When I want to get my value from the dropdown and call my function. My event get some proxy object.

  handleTagChange(e) {
    console.log("handleTagChange");
    console.log(e);
  }

But if I add something else like test in the function, the e.target.value works and test is the proxy object. Why is that?

  handleTagChange(test, e) {
    console.log("handleTagChange");
    console.log(test);
    console.log(e);
  }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

All event handlers that semantic-ui-react components implement return the React Synthetic Event as the first argument (as vanilla React would) and component props + relevant state as the second argument.

Using your example:

handleTagChange(e, data) {
  console.log("handleTagChange");
  console.log(e); // React Synthetic Event
  console.log(data.name); // `name` prop
  console.log(data.value); // `value` that was just selected
}

Issue formalizing this change: https://github.com/Semantic-Org/Semantic-UI-React/issues/623

Explanation of the rationale behind this from the discussion here: https://github.com/Semantic-Org/Semantic-UI-React/issues/638

The event.target is a browser event property. However, many Semantic UI components, such as a Dropdown, Checkbox, and Radio do not work directly with native browser form controls such as input and select. They are built using stylized markup and custom internal state.

Because of this, there are no native browser events available for certain callbacks. This is why all change events in Semantic-UI-React provide the event first (when available) but also a second argument which contains the data you need. You should never have to access the native browser event for most tasks.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!