Skip to content

Conversation

@liamfd
Copy link

@liamfd liamfd commented Jul 24, 2019

Summary

Moves the @types/react-native dependency to peer dependencies.

For context, this is useful because otherwise, a user of this library with a direct dependency on @types/react-native can wind up with two different versions of the @types/react-native installed, one under node_modules/@types/react-native and one under node_modules/react-native-markdown-renderer/node_modules/@types/react-native. That results in TypeScript errors like:

node_modules/react-native-markdown-renderer/node_modules/@types/react-native/index.d.ts:9488:11 - error TS2451: Cannot redeclare block-scoped variable 'originalXMLHttpRequest'.

9488     const originalXMLHttpRequest: any;
               ~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@types/react-native/index.d.ts:9574:11
    9574     const originalXMLHttpRequest: any;
                   ~~~~~~~~~~~~~~~~~~~~~~
    'originalXMLHttpRequest' was also declared here.

This should resolve #53.

There's another PR for this here: #113, but it appears to make extraneous changes and hasn't seen any responses. I don't mean to step on any toes, just figured this was a more direct way to get a more focused PR up.

I only have a sample size of 1, but this change works in my project, and does not break the existing typing as far as I can tell.

If there's anything I can do to help get this across the line, please let me know.

@scottyeck
Copy link

@mientjan Any thoughts on this PR?

ardeaf added a commit to ardeaf/react-native-markdown-renderer that referenced this pull request Nov 4, 2019
Move @types/react-native to Peer Dependencies
@liamfd liamfd closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript typings packages listed as runtime dependencies

2 participants