Closed khanetor closed 8 years ago
I guess it's not yet updated in alt 0.17.6 ? Or is it under a different repo in NPM?
It won't be part of alt. It's on npm
npm install alt-container
Oh, so it is a separated package now right? I didn't see any documentation on this :)
It seems like the package of Alt being served isn't including that version of AltContainer that you linked @goatslacker. I'm currently on version 0.17.7 and components/AltContainer is still the old version.
@Lockyy @nlhkh
npm install alt-container
and in your app
import AltContainer from 'alt-container';
The legacy AltContainer is also available in that package so you can also use it with older versions of alt.
I'm running into the same error with react-native, but it was causing the whole app to fail with message Requiring unknown module "react/addons"
and gives AltContainer.js:58
as the problem line.
Indeed that line contains: var React = require('react/addons')
If I install the alt-container
package and use import AltContainer from 'alt-container'
, then I get the error Requiring unknown module "react"
and gives AltContainer.js:74
as the problem line.
And this line contains: var _react = require('react');
So is there any way to work around this?
Edit/Solution:
I googled again, and came across http://alt.js.org/guide/container-components/, which says to use AltNativeContainer
. So now I have:
import AltContainer from 'alt/AltNativeContainer';
and there is no more missing module issue.
In React 0.14, AltContainer still use the addons from React 0.13.3, and this error message shows up