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

Differences to React: supported React child types #909

Open
quizzl opened this issue Sep 20, 2022 · 0 comments
Open

Differences to React: supported React child types #909

quizzl opened this issue Sep 20, 2022 · 0 comments

Comments

@quizzl
Copy link

quizzl commented Sep 20, 2022

I recently ran into a mismatch in supported child types migrating a codebase with Immutable.js lists:

import { List } from 'immutable'
class App extends Component {
  render() { return <div>{List([42])}</div>; }
  // React renders 42, default preact silently fails
}

This difference is obvious with preact/debug and we get "Objects are not valid as a child.", but it's a confusing surprise if you're used to it and lists stop showing up, especially if they're not used everywhere.

I'm not sure how many child types differ in support between Preact and React. If it's so many that it's not worth maintaining a list, then I think some advice about enabling preact/debug during a migration and looking for failing child types is helpful, and I'd gladly write a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant