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

162
Views
Returning a JSX component from an event listener

This is more for research than a real use case. But I'm interested if something like this is even possible.

I would like to return an event listener as a component, where the content is updated based on the data that is passed.

At the moment I can return the callback from the listener, but the values never update, I wonder if it's possible to compose this function/component in a way that would update based on this param that is sent?

Example:

const ChooseRating = () => {
  return (
    <button class="choose-rating" onClick={() => Emitter.send('rating', 4)}>
      Choose rating
    </button>
  )
}

const ShowRating = () => {
  return Emitter.listen('rating', (rating) => (<div>{rating}</div>))
}

ps: I'm using Solid.js for this at the moment, but if you know how to do this in React or any other JSX based thing let me know!

about 4 years ago · Juan Pablo Isaza
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!