Skip to content
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

Bug: TypeError: Object is not a function or its return value is not iterable (0.0.0-experimental-7b84dbd16) #21095

Closed
jsoneaday opened this issue Mar 25, 2021 · 9 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@jsoneaday
Copy link

I am playing around with concurrent mode and get this error when calling useTransition. Has this function been removed or renamed?

React version: 0.0.0-experimental-7b84dbd16

Steps To Reproduce

  1. Use unstable_createRoot in index.js to enable concurrent mode
  2. import useTransition from react in App.js
  3. Try and call useTransition like this
    const [startTransition, isPending] = useTransition({
    timeoutMs: 3000,
    });

Link to code example:
I don't have one

The current behavior

image

image

The expected behavior

I was trying to test transitions in concurrent mode so I would think it would just transition.

@jsoneaday jsoneaday added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Mar 25, 2021
@eps1lon
Copy link
Collaborator

eps1lon commented Mar 25, 2021

It was renamed to unstable_useTransition. timeoutMS was also removed.

@bvaughn
Copy link
Contributor

bvaughn commented Mar 25, 2021

Link to code example:
I don't have one

The idea is that you'd create one using something like Code Sandbox :)

Without a repro I can't be positive, but it seems like @eps1lon has answered this question though, so I'm going to close this issue for now.

@bvaughn bvaughn closed this as completed Mar 25, 2021
@jsoneaday
Copy link
Author

@eps1lon thank you. But now I get an error that App suspended while rendering, but no fallback UI was specified. As you can see I do have a fallback set and this is my only call to Suspend.

image

@gaearon
Copy link
Collaborator

gaearon commented Mar 25, 2021

<Suspense> needs to be above the component that Suspended. In your example, App Suspended, so you want to place <Suspense> above it. Alternatively, you can move the setMessage call into Child.

@jsoneaday
Copy link
Author

Thank you Dan. Really appreciate it.

@gaearon
Copy link
Collaborator

gaearon commented Mar 25, 2021

No problem. Appreciate you playing with experimental stuff! Sorry the docs are rough/outdated. We're focused on polishing this and getting it into a releasable stage and then we'll have better docs.

@gaearon
Copy link
Collaborator

gaearon commented Mar 25, 2021

Btw, https://github.com/reactjs/server-components-demo is the latest thinking on how the pieces fit together. So feel free to check that out too. It has a few uses of useTransition.

@jsoneaday
Copy link
Author

jsoneaday commented Mar 25, 2021

@gaearon I totally understand. I should have done my own investigation before I submitted. I love React and am eagerly waiting for concurrent mode.

@gaearon
Copy link
Collaborator

gaearon commented Mar 25, 2021

No worries at all, it's a bit hard to find the info now. Feel free to ask any follow-up questons here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

4 participants