question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support to Preact X

See original GitHub issue

Hey.

I observed that there’s no support to Preact X yet.

Specifically, the typescript compiler emits an error about code using the attributes attribute in the VNode structure, like this example.

I imagine this is related to the fact that in Preact X the VNode shape has changed, and now attributes is just props in the VNode structure. According to Typescript compiler, there’s a few other cases where the same error occurs.

So here’s the question: What’s the plan to support Preact X? Would this package have a version compatible with both versions (assuming this is the unique problem, of course), or we would release a new version supporting only Preact X?

PS: I know that Preact X is still in alpha but I think it’s better to prepare for it than await to a stable release…What you think?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Drapegnikcommented, Sep 10, 2019

I confirm that works with:

declare global {
  // FIXME
  // https://github.com/preactjs/preact/issues/1036#issuecomment-491409239
  // eslint-disable-next-line @typescript-eslint/no-namespace
  namespace JSX {
    type Element = JSXInternal.Element;
    type HTMLAttributes = JSXInternal.HTMLAttributes;
  }
}
  • preact-material-components@1.6.0
  • preact@10.0.0-rc.2
1reaction
prateekbhcommented, Sep 9, 2019

released 1.6.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in Preact X
New features and changes in Preact X. ... Same goes for compatibility enhancements to support more third-party libraries. In a nutshell Preact X...
Read more >
Upgrading from Preact 8.x
This document is intended to guide you through upgrading an existing Preact 8.x application to Preact X and is divided in 3 main...
Read more >
Switching to Preact (from React)
Switching to Preact can be as easy as installing and aliasing preact-compat in for react and react-dom . This lets you continue writing...
Read more >
Switching to Preact (from React)
Everything you need to know to switch from React to Preact.
Read more >
Browser Support | Preact
Preact supports modern browsers (Chrome, Firefox, Safari, Edge) and IE11. It works out of the box with these browsers and no additional polyfills...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found