Skip to content

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

@jsoneaday

Description

@jsoneaday

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.

Activity

eps1lon

eps1lon commented on Mar 25, 2021

@eps1lon
Collaborator
bvaughn

bvaughn commented on Mar 25, 2021

@bvaughn
Contributor

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.

jsoneaday

jsoneaday commented on Mar 25, 2021

@jsoneaday
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

gaearon commented on Mar 25, 2021

@gaearon
Collaborator

<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

jsoneaday commented on Mar 25, 2021

@jsoneaday
Author

Thank you Dan. Really appreciate it.

gaearon

gaearon commented on Mar 25, 2021

@gaearon
Collaborator

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

gaearon commented on Mar 25, 2021

@gaearon
Collaborator

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

jsoneaday commented on Mar 25, 2021

@jsoneaday
Author

@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

gaearon commented on Mar 25, 2021

@gaearon
Collaborator

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bvaughn@gaearon@jsoneaday@eps1lon

        Issue actions

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