question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn when reading from event which has been returned to the pool

See original GitHub issue

The title is an assumption based on my experience upgrading. Here’s an example of what I’m seeing:

const App = React.createClass({
  getInitialState() {
    return {clicked: 0}
  },
  handleClick(e) {
    console.log('e.target before callback is null?', e.target === null) // e.target is not null here
    this.setState({
      clicked: this.state.clicked + 1
    }, () => {
      console.log('e.target after callback is null?', e.target === null) // e.target is null here
    })
  },
  render() {
    return (
      <div
        onClick={this.handleClick}
      >
        Click me {this.state.clicked}
      </div>
    )
  }
})

ReactDOM.render(<App />, document.getElementById('root'))

Here’s a jsbin that demonstrates the behavior with 0.14.6: https://jsbin.com/gasozit/edit?js,console,output

Here’s a jsbin with 0.14.7: https://jsbin.com/vaberi/edit?js,console,output

Notice in the console, that the log inside the callback is logging that e.target === null evaluates to true. In my app, I’m passing the event to an onChange handler which utilizes the target. So this update breaks that situation.

This may or may not be a bug. It may just be necessary for avoiding the memory leak. If that’s the case, then it’s a support request 😄 How should I handle this if I’m passing the event to another callback and I want that event to have references to things like target?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
gaearoncommented, Jan 29, 2016

I didn’t know persist() existed! This made my day.

0reactions
kentcdoddscommented, Jan 29, 2016

I’d love to make this my first contribution if you don’t mind holding off for a bit for me to work on it. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

multiprocessing — Process-based parallelism — Python 3.11 ...
The Pool class represents a pool of worker processes. It has methods which allows tasks to be offloaded to the worker processes in...
Read more >
Connection Pooling - SQLAlchemy 1.4 Documentation
The pool includes “reset on return” behavior which will call the rollback() method of the DBAPI connection when the connection is returned to...
Read more >
Serverless SQL pool self-help - Azure Synapse Analytics
This article contains information about how to troubleshoot the most frequent problems with serverless SQL pool in Azure Synapse Analytics.
Read more >
People warned not to skate on reflecting pools | DC News Now
While ice skating on the Lincoln Memorial Reflecting Pool was common ... If you would like to continue with this survey, please read...
Read more >
Operator information messages - IBM
You can view and monitor these messages (Event, Host Message, or Call Home MDE) through the ... The Read/Write ownership takeover mode has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found