Skip to content

Issues using react-localize-redux without redux #119

@calestar

Description

@calestar

Hi !

According to the release notes from 3.0, react-localize-redux is supposed to be usable without using redux. But I seem to be getting issues compiling.

When trying to start a new project with bare bones dependencies:

  "dependencies": {
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-localize-redux": "^3.3.2"
  },

And a really basic index.jsx:

import React from 'react';
import { render } from 'react-dom';
import { LocalizeProvider } from 'react-localize-redux';

class App extends React.Component<any, any> {
  render() {
    console.log(this.state.store);
    return (
      <LocalizeProvider>
        bloop
      </LocalizeProvider>
    );
  }
}

render(<App />, document.getElementById('root'));

I get compile issues:

ERROR in ./node_modules/react-localize-redux/es/localize.js
Module not found: Error: Can't resolve 'redux' in '[snip]/node_modules/react-localize-redux/es'
 @ ./node_modules/react-localize-redux/es/localize.js 10:0-40
 @ ./node_modules/react-localize-redux/es/index.js

ERROR in ./node_modules/react-localize-redux/es/LocalizeProvider.js
Module not found: Error: Can't resolve 'redux' in '[snip]/node_modules/react-localize-redux/es'
 @ ./node_modules/react-localize-redux/es/LocalizeProvider.js 10:0-15
 @ ./node_modules/react-localize-redux/es/index.js

ERROR in ./node_modules/react-localize-redux/es/utils.js
Module not found: Error: Can't resolve 'redux' in '[snip]/node_modules/react-localize-redux/es'
 @ ./node_modules/react-localize-redux/es/utils.js 4:0-15
 @ ./node_modules/react-localize-redux/es/localize.js
 @ ./node_modules/react-localize-redux/es/index.js

Exact yarn.lock for react-localize-redux:

react-localize-redux@^3.3.2:
  version "3.3.2"
  resolved "https://registry.yarnpkg.com/react-localize-redux/-/react-localize-redux-3.3.2.tgz#cf42a90bdd640bf0fd92f3528f3e1707232cc9dc"
  dependencies:
    create-react-context "^0.2.2"
    flat "^2.0.1"
    prop-types "^15.6.1"
    reselect "^3.0.1"

I quite new at all this, so I'm expecting that I'm doing something wrong :-)

Thanks for any help,
Js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions