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.

Network requests on each render

See original GitHub issue

Hi! Thanks for the module.

I have an example here: http://requirebin.com/?gist=f2a99cc27c465ed51eb8159830836ca4. In it, each time I call update and bel creates a new element, a local network request is made for the base64 inlined image, even though it did not change.

Should this be happening? I guess it makes sense, new element is created, bel is fetching it’s content. But that results in a poor performance — when I add a relatively large image, like 3mb, the Chrome browser tab can barely function and the interface becomes unusable.

To reproduce: navigate to http://uppy.io/examples/modal/index.html, click “open modal” and drag two files to the dragdrop area. Open network tab, click “upload”.

What am I doing wrong? Thank you!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
timwiscommented, Aug 6, 2016

Reported to morphdom at patrick-steele-idem/morphdom#77

2reactions
yoshuawuytscommented, May 27, 2016

but I think it’d be nice to make the problem hidden from developers

Don’t think that’s possible - controlling re-renders is something that comes with the job I’m afraid. Be it through shouldComponentUpdate in React, manual diffing using thunks or setting lifecycle hooks to load and unload data. I reckon the best we can do is document it and make it as transparent as possible - that way we keep control which is a great thing.

I’ll add docs for this in choo, as I reckon you’re right and this is definitely a framework-level concern too. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

In React.js should I make my initial network request in ...
If I do so in componentDidMount , the component is rendered, the request is made, the state is changed, then the component is...
Read more >
Web Services | Render · Cloud Hosting for Developers
Render automatically builds and deploys your service every time you push to your repository. Our platform has native support for Node.js, Python, Ruby,...
Read more >
Network Requests - Cypress Documentation
Cypress helps you test the entire lifecycle of HTTP requests within your application. Cypress provides you access to the objects with information about...
Read more >
Server-side rendering (SSR) with Angular Universal
It might respond to data requests, either directly or as a proxy to a separate data server. The sample web server for this...
Read more >
API Reference - Express 4.x
Returns middleware that only parses JSON and only looks at requests where the ... As req.body 's shape is based on user-controlled input,...
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