Network requests on each render
See original GitHub issueHi! 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:
- Created 7 years ago
- Comments:18 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reported to morphdom at patrick-steele-idem/morphdom#77
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!