supernoir / wikivent

3 stars 0 forks source link

Solve Issue with Re-render when using Rest Hooks for API call #11

Closed supernoir closed 4 years ago

supernoir commented 4 years ago

Current Behavior: The page renders infinitely often when using rest hooks payloads in a page, causing the browser to crash

Expected Behavior Rest hooks handle API calls without re-rendering the page when data is used in render method

supernoir commented 4 years ago

I spent sometime trying to understand the underlying problem but finally decided to raise a bug with REST hooks. This ticket is blocked until the Bug is resolved:

For reference: https://github.com/coinbase/rest-hooks/issues/341

supernoir commented 4 years ago

The issue could be resolved through the following means:

It is however necessary to refactor and optimize the code and find out why application/json needed to be converted to string to begin with (which happens when REST Hooks encounters a non-JSON response), as the API should only serve JSONs

Follow-up ticket: https://github.com/supernoir/wikivent/issues/20