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.

Type Error (React 18.2.0)

See original GitHub issue

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-split-pane@0.1.92 for the project I’m working on.

I got the following error:

Type error: Type '{ children: Element[]; split: "vertical"; minSize: number; defaultSize: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<SplitPane> & Pick<Readonly<SplitPaneProps>, never> & InexactPartial<...> & InexactPartial<...>'.
  Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<SplitPane> & Pick<Readonly<SplitPaneProps>, never> & InexactPartial<...> & InexactPartial<...>'.

   7 | const Home: NextPage = () => {
   8 |   return (
>  9 |     <SplitPane split='vertical' minSize={50} defaultSize={100}>
     |      ^
  10 |       <div />
  11 |       <div />
  12 |     </SplitPane>

Here is the diff that solved my problem:

diff --git a/node_modules/react-split-pane/index.d.ts b/node_modules/react-split-pane/index.d.ts
index d116f54..3c7eb24 100644
--- a/node_modules/react-split-pane/index.d.ts
+++ b/node_modules/react-split-pane/index.d.ts
@@ -5,6 +5,7 @@ export type Size = string | number;
 export type Split = 'vertical' | 'horizontal';
 
 export type SplitPaneProps = {
+  children: React.ReactNode[],
   allowResize?: boolean;
   className?: string;
   primary?: 'first' | 'second';

This issue body was partially generated by patch-package.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

7reactions
OldManMetacommented, Sep 5, 2022

Actually - I just found a new split panel package that works nicely with React 18

It’s also being actively maintained by the look of it:

https://github.com/johnwalley/allotment

0reactions
OldManMetacommented, Sep 5, 2022

@lewismazzei thanks for walking through that, much appreciated. Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Next.js requires React 18.2.0 to be installed. #41855
I have React 18.2.0 installed, but I get an error Next.js requires React 18.2.0 to be installed. during build firebase.
Read more >
React 18 + CSSTransition makes error : TypeError: Cannot ...
I found solution here, i changed my routing as in example http://reactcommunity.org/react-transition-group/with-react-router.
Read more >
@types/react - npm
Start using @types/react in your project by running `npm i @types/react`. There are 13578 other projects in the npm registry using @types/react.
Read more >
Upgrading to React 18 with TypeScript - LogRocket Blog
The upgrade of the React type definitions to support React 18 involved some significant breaking changes that developers should know about.
Read more >
Module not found: Can't resolve 'react/jsx-runtime' | bobbyhadz
To solve the error "Module not found: Error: Can't resolve 'react/jsx-runtime'", make sure to update the react package by opening your terminal in...
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