Menelaos Kotoglou
06/07/2023, 12:37 PMMenelaos Kotoglou
06/07/2023, 12:40 PM*import* { BackendProvider, WorkspaceProvider } *from* "@gooddata/sdk-ui";
Seems that there is an incompatibility between material UI and the sdk-ui elements. Do we have any known issues about what the issue may be?
My package.json looks like this:
{
"@gooddata/api-client-tiger": "^8.12.1",
"@gooddata/sdk-backend-tiger": "^8.12.1",
"@gooddata/sdk-ui": "^8.12.1",
"@gooddata/sdk-ui-all": "^8.12.1",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
}
And these are an example of the errors I'm gettingJan Rehanek
06/07/2023, 1:02 PMMenelaos Kotoglou
06/07/2023, 1:05 PMApp.tsx
import tigerFactory, { ContextDeferredAuthProvider, redirectToTigerAuthentication } from '@gooddata/sdk-backend-tiger';
...
const backend = tigerFactory().withAuthentication(new ContextDeferredAuthProvider(redirectToTigerAuthentication));
...
const App: FC = () => {
const theme = createTheme();
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<StylesProvider>
...
In that file, I get the errors as provided above. Is it enough or need to provide more data from my side?Jan Rehanek
06/07/2023, 1:06 PMMenelaos Kotoglou
06/07/2023, 1:07 PMJan Rehanek
06/07/2023, 1:07 PMMenelaos Kotoglou
06/07/2023, 1:08 PM"react": "^17.0.1",
"typescript": "^4.2.4"
Jan Rehanek
06/07/2023, 1:09 PMJan Rehanek
06/07/2023, 1:26 PM@material-ui
dependencies that you have hasn’t lead to the same error for me, so I don’t expect there’s any natural incompatibility. The StylesProvider
etc components work fine with 8.12.1 SDK
Googling around a bit, I came up with a few StackOverflow entries and GitHub issue, e.g. https://stackoverflow.com/questions/71831601/ts2786-component-cannot-be-used-as-a-jsx-component. Any chance this could help?Menelaos Kotoglou
06/07/2023, 1:31 PMimport { BackendProvider, WorkspaceProvider } from '@gooddata/sdk-ui';
. When I remove the import, all issues seem to be fading out.Jan Rehanek
06/07/2023, 1:33 PMJan Rehanek
06/07/2023, 1:35 PMMenelaos Kotoglou
06/07/2023, 1:36 PMJan Rehanek
06/07/2023, 2:25 PM"typescript": "^4.2.4"
. Any idea what could be the cause of that?
Additionally, could you please make sure you have the correct @types/react?Menelaos Kotoglou
06/07/2023, 2:36 PM"@types/d3": "^7.0.0",
"@types/file-saver": "^2.0.5",
"@types/jest": "^27.0.2",
"@types/lodash": "^4.14.177",
"@types/node": "^17.0.5",
"@types/react": "^17.0.0",
"@types/react-beautiful-dnd": "^13.1.2",
"@types/react-dom": "^17.0.3",
"@types/yup": "^0.29.11",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
Jan Rehanek
06/07/2023, 2:42 PMMenelaos Kotoglou
06/07/2023, 5:08 PMBoris
06/08/2023, 6:58 AMMenelaos Kotoglou
06/08/2023, 6:59 AMBoris
06/08/2023, 8:35 AMMenelaos Kotoglou
06/08/2023, 10:25 AMBoris
06/08/2023, 10:39 AMMenelaos Kotoglou
06/08/2023, 10:44 AMBoris
06/08/2023, 10:45 AMMenelaos Kotoglou
06/08/2023, 10:46 AMreact-intl@5.25.1
Boris
06/08/2023, 3:43 PMMenelaos Kotoglou
06/08/2023, 8:52 PMMenelaos Kotoglou
06/09/2023, 9:07 AMBoris
06/09/2023, 9:33 AMBoris
06/09/2023, 1:14 PMMenelaos Kotoglou
06/09/2023, 1:15 PMBoris
06/09/2023, 1:33 PMMenelaos Kotoglou
06/09/2023, 1:34 PMJan Rehanek
06/12/2023, 7:01 AMMenelaos Kotoglou
06/12/2023, 8:19 AMJan Rehanek
06/12/2023, 8:22 AMMenelaos Kotoglou
06/12/2023, 9:07 AMMenelaos Kotoglou
06/12/2023, 10:48 AMJan Rehanek
06/12/2023, 10:53 AMJan Rehanek
06/12/2023, 12:52 PMreact-intl
that has broad dependency on @types/react: 16 || 17 || 18
and even when package.json explicitly mentions we want to use version ^17.0.0
, it is used for some dependencies but for react-intl, version 18 is used instead as it is the newest matching the broad rule.
Adding "@types/react": "17.0.61"
to the "resolution"
object of package.json
and the problem in App.tsx
goes away. Highlighted in the picture below:Jan Rehanek
06/12/2023, 4:26 PMMenelaos Kotoglou
06/12/2023, 4:27 PMJan Rehanek
06/12/2023, 4:34 PM