Skip to content

import { Children } from 'react' doesn't work #214

Closed
@mortenk

Description

@mortenk

Describe the bug

If I use:
import { Children } from 'react';
I get errors in the console like:
TypeError: q.toArray is not a function
Replacing it with:
import React from 'react'
and calling e.g React.Children.toArray() instead Children.toArray() of works fine
It's not just toArray, it's any function on Children

Reproduction

https://stackblitz.com/edit/vitejs-rolldown-vite-x8xgtbpn?file=src%2FApp.jsx

Steps to reproduce

No response

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 416.81 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.6.1 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 11.3.0 - ~/.npm/bin/npm
    bun: 1.2.8 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 137.0.7151.68
    Edge: 137.0.3296.62
    Safari: 18.5

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions