Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Type 'ThemeModalStyle' is not assignable to type 'Styles'. TS2322 #587

Open
SvenMeyer opened this issue Jan 14, 2020 · 6 comments
Open

Type 'ThemeModalStyle' is not assignable to type 'Styles'. TS2322 #587

SvenMeyer opened this issue Jan 14, 2020 · 6 comments

Comments

@SvenMeyer
Copy link

As suggested during build, I ran a yarn upgrade.
Thereafter I got the error:

src/components/account/wallet_weth_balance.tsx
TypeScript error in src/components/account/wallet_weth_balance.tsx(220,25):
Type 'ThemeModalStyle' is not assignable to type 'Styles'.  TS2322

    218 |                         onRequestClose={this.closeModal}
    219 |                         onSubmit={this.handleSubmit}
  > 220 |                         style={theme.modalTheme}
        |                         ^
    221 |                         totalEth={totalEth}
    222 |                         wethBalance={wethBalance}
    223 |                     />
@aeslami
Copy link

aeslami commented Jan 27, 2020

Same here, didn't do upgrade though, just cloned, npm install and npm start

@vm06007
Copy link

vm06007 commented Feb 14, 2020

same here, how to fix this?

@vm06007
Copy link

vm06007 commented Feb 16, 2020

seems you need to make sure not to upgrade to latest react-modal, please use in package.json "react-modal": "3.8.1", strict version and don't do yarn upgrade - then should work, at least worked for me!

@hoangld-ibl
Copy link

My solution:

  • import {Styles} from 'react-modal';
  • Replace all "theme.modalTheme" (style={theme.modalTheme}) by "theme.modalTheme as Styles" (style={theme.modalTheme as Styles})

@dekz
Copy link
Member

dekz commented Mar 4, 2020

As suggested during build, I ran a yarn upgrade

Can you point to the docs which recommend a yarn upgrade? We have commited a yarn.lock to lock the dependencies to this tested version.

npm install

This project uses yarn as mentioned in the README.

"react-modal": "3.8.1",

I'll pin to this specific version to prevent frustrations of those using npm/yarn upgrade

@xumoyan
Copy link

xumoyan commented May 14, 2020

as Styles

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

No branches or pull requests

6 participants