New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a url property in a resource response #106
Comments
Ah yes, the error thrown is "TypeError: setting getter-only property "url"" What's going on is there's a convenience getter that returns an items url. However, in cases where they have their own member it tries to set which doesn't work. I'll look into a fix for this. |
Nice, i just went through this trying to do the "hello world" using the SWAPI api, was just unlucky with the response containing a url property, the example on the docs is awesome, but probably having an easier or less complex one would be nice to let the idea sink |
Are you referring to this example in the docs: https://resthooks.io/docs/guides/resource-types as being too complex? My plan is to create a really simple forum api to build a new demo with (the github api is quite complex so it makes first intro kinda overwhelming). Then I could probably change most of my examples to actually match the demo api and then you could just go into the demo page yourself. How does that sound? |
Fix released in https://github.com/coinbase/rest-hooks/releases/tag/2.0.2 |
@ntucker no, my bad, not an example but a demo. I think this one https://codesandbox.io/s/rest-hooks-hinux?fontsize=14&module=%2Fsrc%2Fpages%2FIssueList.tsx is really complex as a first impression of the library. Me as a new user landed on https://resthooks.io/ clicked demo before reading anything and saw a lot of files and that shocked me a little bit. Probably seeing a minimal example first is better for newcommers. |
Gotcha. Ok, having a simpler demo example to not overwhelm people. I'll put that on my future work; makes sense to me. |
I get an error when the response of a resource contains a property named
url
Reproduced here:
https://codesandbox.io/s/weathered-meadow-46fmn
Go to
resource.js
and uncomment the commented line.I still didn't check why this could be happening but will try to take a look in these days
The text was updated successfully, but these errors were encountered: