Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11.5.1 or newer TypeScript issue with styled components #381

Closed
bezenson opened this issue Dec 1, 2019 · 17 comments · Fixed by #647
Closed

11.5.1 or newer TypeScript issue with styled components #381

bezenson opened this issue Dec 1, 2019 · 17 comments · Fixed by #647

Comments

@bezenson
Copy link

bezenson commented Dec 1, 2019

Versions

  • react-native-modal: 11.5.1 or newer
  • react-native: 0.61.5
  • react: 16.12.0
  • styled-components: 4.4.1

Description

I see in change log was add TypeScript support. I use styled components and started get next error here:

const StyledModal = styled(Modal)`
  margin: 0;
`;

Снимок экрана 2019-12-01 в 21 40 51

@bezenson bezenson added the bug label Dec 1, 2019
@bezenson bezenson changed the title 11.5.2 or newer TypeScript issue with styled components 11.5.1 or newer TypeScript issue with styled components Dec 1, 2019
@mmazzarolo
Copy link
Member

I'm not familiar with styled-components in react-native. Could it be because we need to expose the "style" prop in the TS interface?

@sakarisson
Copy link

Not sure exactly what is the reason, but it has to do with the typings of getDerivedStateFromProps

@ancyrweb ancyrweb closed this as completed Apr 2, 2020
@aldebout
Copy link

@rewieer I'm wondering why you're closing this.
I understand the need for maintenance and I'd like to thank you for doing that work, but this issue is still in need of resolution ;)

@ammichael
Copy link

Why is this closed? This issue is still happening

@duspada
Copy link

duspada commented May 2, 2020

I'm also getting this error...

@luisgurmendezMLabs
Copy link

luisgurmendezMLabs commented May 4, 2020

Workaround for now (the styles are applying to the Modal):

const Modal = styled((ModalBase as any))

This error should be fix tho as it might introduce some bugs

@ancyrweb
Copy link
Member

ancyrweb commented May 6, 2020

@aldebout having no feedbacks since December I archived it. Since it pops up, i'm going to reopen it.
I'm not using styled components, unfortunately.

@ancyrweb ancyrweb reopened this May 6, 2020
@jianxiao-chen
Copy link

I'm also getting this error...

Workaround for now (the styles are applying to the Modal):

const Modal = styled((ModalBase as any))

This error should be fix tho as it might introduce some bugs

This works.

@agnislav
Copy link

agnislav commented Apr 22, 2021

The error still exists. Used the as any workaround

@Will-PlatformBuilders
Copy link

Persists on

react-native-modal: 11.10.0
react-native: 0.64.1
react: 17.0.2
styled-components: 5.3.0
@types/styled-components-react-native: 5.1.1

@ilanrot90
Copy link

still on

@SaidKherif
Copy link

Still on
"react-native-modal": "13.0.0",
"@emotion/native": "11.0.0",

@gabriel11447
Copy link

gabriel11447 commented Oct 1, 2021

still on

"react-native-modal": "^13.0.0",
"react-native": "0.64.2",

@searesdavi
Copy link

Still on

1 similar comment
@velcis
Copy link

velcis commented Feb 9, 2022

Still on

github-actions bot pushed a commit that referenced this issue Mar 1, 2022
## [13.0.1](v13.0.0...v13.0.1) (2022-03-01)

### Bug Fixes

* make getDerivedStateFromProps's nextProps param Readonly ([#647](#647)) ([c737e7f](c737e7f)), closes [#381](#381)
@github-actions
Copy link

github-actions bot commented Mar 1, 2022

🎉 This issue has been resolved in version 13.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

happyboy000916 added a commit to happyboy000916/react-native-modal that referenced this issue May 31, 2023
## [13.0.1](react-native-modal/react-native-modal@v13.0.0...v13.0.1) (2022-03-01)

### Bug Fixes

* make getDerivedStateFromProps's nextProps param Readonly ([#647](react-native-modal/react-native-modal#647)) ([c737e7f](react-native-modal/react-native-modal@c737e7f)), closes [#381](react-native-modal/react-native-modal#381)
@lindan4
Copy link

lindan4 commented Jul 31, 2023

This seems to be an issue with newer versions of TypeScript and/or styled-components.

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

Successfully merging a pull request may close this issue.