Conflict with react-bootstrap
borisalekseev opened this issue · 7 comments
Describe the bug
When using both reagraph and react-bootstrap library together there is absolutely random problem with Button element from react-bootstrap. I couldn't find any regularity but some buttons work normally, in other error is raising:
TS2590: Expression produces a union type that is too complex to represent.
Espetially unexpected is that error raises at random time in other react-bootstrap elements, i suppose this is due to the large number of iterations when calculating types, but i have no cnfidence about it and have no idea why its happen.
Steps to Reproduce the Bug or Issue
In element like this error is raising:
`
import React from "react"
const El:React.FC = () => (
{/* i haven't even import from reagraph in this module /}
{/ @ts-ignore-next-line only this 'hack' helps now*/}
<Button onClick={() => myFunc({name: "", type: ""})}>Add
)
`
Expected behavior
Expected behavior is no error.
Screenshots or Videos
No response
Platform
- Reagraph Version: 4.14.2
- OS: ubuntu 22.04
- NodeJS version: 20.7.0
- react-bootstrap version 2.9.1
Your Example Website or App
No response
Additional context
here is tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
Can you provide an example via Github repo or Codesandbox?
@amcdnl here is the example, screenshot also in src folder
https://github.com/borisalekseev/reagraph-bug-example
So if you import this line - https://github.com/borisalekseev/reagraph-bug-example/blob/master/src/App.tsx#L5 - it crashes but if its not there it doesnt?
@amcdnl yes, exactly.
Can you retry now? We changed some things internally that might have been causing the conflict.