You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set up a very simple test case to show the fetcher data being wrong. This seems like a test-only issue as I discovered it while using createRemixStub, and I haven't seen a similar issue before in my actual app.
I wasn't sure whether to file this in the react-router or remix repository, but I think the core issue is here in react-router, even though the reproduction uses Remix.
Follow instructions to simply flip between pnp (failing) and non-pnp (passing) mode.
Expected Behavior
The fetcher returned from useFetcher should include a data value of { result: 100 }, as returned from the action.
Actual Behavior
The data property from useFetcher() stays undefined, even after the action successfully returns.
Interestingly the fetcher details returned from useFetchers() (plural) does show the resolved action data - which is very strange.
Took a bit of a look but the RR code is fairly complex. There is a suspicious looking fetcherData ref, which is passed down to in a context provider value as fetcherData.current, which could maybe be a source of pain (as changing a ref value won't automatically trigger re-render). But that's just a hunch.
The text was updated successfully, but these errors were encountered:
What version of React Router are you using?
6.27.0
Steps to Reproduce
See reproduction + Readme here: https://codesandbox.io/p/devbox/5xv9jn?file=%2FREADME.md%3A25%2C37
I have set up a very simple test case to show the fetcher data being wrong. This seems like a test-only issue as I discovered it while using
createRemixStub
, and I haven't seen a similar issue before in my actual app.I wasn't sure whether to file this in the react-router or remix repository, but I think the core issue is here in react-router, even though the reproduction uses Remix.
Follow instructions to simply flip between
pnp
(failing) andnon-pnp
(passing) mode.Expected Behavior
The fetcher returned from
useFetcher
should include adata
value of{ result: 100 }
, as returned from the action.Actual Behavior
The
data
property fromuseFetcher()
stays undefined, even after the action successfully returns.Interestingly the fetcher details returned from
useFetchers()
(plural) does show the resolved action data - which is very strange.Took a bit of a look but the RR code is fairly complex. There is a suspicious looking
fetcherData
ref, which is passed down to in a context provider value asfetcherData.current
, which could maybe be a source of pain (as changing a ref value won't automatically trigger re-render). But that's just a hunch.The text was updated successfully, but these errors were encountered: