Skip to content

Support for react-native-web #2

Open

Description

@kmalakoff

Great library!

I was trying to use it to create a theme for react-native-web with it aliased in webpack to react-native. Unfortunately, 'react-native/lib/deepDiffer' doesn't exist in react-native-web.

I'm not sure what the best solution is...depend on another library already in npm, to write your own, or to publish Facebook's deepDiffer as a separate npm module to avoid this mismatch?

Activity

  1. doanndd commented on Sep 27, 2016

    @doanndd
    Member

    Thank you for reporting!

    I have updated to new version. Now you can use with react-native-web by adding this code to your webpack.config.js file:

    module.exports = {
      // ...
      resolve: {
        alias: {
          'react-native/lib/deepDiffer': 'react-native-theme/lib/deepDiffer',
          // ... Other aliases
        }
      }
    }
  2. doanndd commented on Sep 28, 2016

    @doanndd
    Member
  3. kmalakoff commented on Sep 28, 2016

    @kmalakoff
    Author

    Thank you for the suggestion and pointers.

    This solution would work if I install react-native in addition to react-native-web (which doesn't require react-native).

    Ideally, for react-native-theme to be compatible with react-native-web, react-native-theme would be compatible with either library without both being installed (including removing the peerDependency on react-native in react-native-theme).

    This is good as a work around, but maybe not a general purpose solution? I guess it depends on your goals for the library if you want to go as far as a fully replaceable react-native with react-native-web.

    Thank you!

  4. doanndd commented on Sep 29, 2016

    @doanndd
    Member

    Thank you for the advice. I'll think about it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions