Started working with slice machine today and immediately got warned by eslint about
React Hook "useGetStaticProps" cannot be called at the top level
which I guess is because eslint is warning for every function call prefixed with use. I don't think I'm doing something wrong since I'm just using the code from official docs. Is this expected behaviour? And if so don't you think that naming this packages something different would be less confusing?
It probably depends on your eslint default configuration @samlittlefair.
I agree that we could get rid of the confusion (not fan of React monopolising the use of use prefix though )
Yes, sorry, I took it for granted that this plugin is in use which I think is highly recommended to have on anyway.
Fair point @hugo.villain, to be honest I had not thought of this aspect, you're right. However in this case I think it is intentionally made to look like a hook even though it isn't really, which from API design standpoint is a bit problematic.
samlittlefair
(Sam Littlefair)
closed , flag & select 'Something Else' to reopen.
6
This issue has been closed due to inactivity. Flag to reopen.