synacor / preact-i18n

Simple localization for Preact.
BSD 3-Clause "New" or "Revised" License
205 stars 18 forks source link

Blank Screen - IntlProvider not rendering children #53

Closed VictorBadea closed 3 years ago

VictorBadea commented 3 years ago

I have been trying to add preact-i18n to my project by it does not seem to want to display its children:

import { createStore, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import thunk from "redux-thunk";
// import ConnectedIntlProvider from "./utils/connected-intl-provider";
import { IntlProvider } from "preact-i18n";

// import App from "./components/app";

import rootReducer from "./reducers/rootReducer";

import "./style.css";

import definition from "./translations/ro.json";

export default () => (
  <Provider store={createStore(rootReducer, applyMiddleware(thunk))}>
    {/* <ConnectedIntlProvider> */}
    <IntlProvider definition={definition}>
      {/* <App /> */}
      <div>TEST</div>
    </IntlProvider>
    {/* </ConnectedIntlProvider> */}
  </Provider>
);

If I inspect the page... there is not div containing TEST inside body... if I just set TEST inside it, it renders the first T. Do I need to do any extra setup?

VictorBadea commented 3 years ago

Nevermind... was using preact x, and force updated the version to 2.1.1-preactx, works now.