goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 323 forks source link

AltContainer using depreciated React-Addons #521

Closed khanetor closed 8 years ago

khanetor commented 8 years ago

In React 0.14, AltContainer still use the addons from React 0.13.3, and this error message shows up

Warning: require('react/addons') is deprecated. Access using require('react-addons-{addon}') instead.
goatslacker commented 8 years ago

No it doesn't https://github.com/altjs/container/blob/master/src/AltContainer.js#L58 :)

ghost commented 8 years ago

I guess it's not yet updated in alt 0.17.6 ? Or is it under a different repo in NPM?

goatslacker commented 8 years ago

It won't be part of alt. It's on npm

npm install alt-container

khanetor commented 8 years ago

Oh, so it is a separated package now right? I didn't see any documentation on this :)

Lockyy commented 8 years ago

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.

screen shot 2015-10-29 at 18 19 43

goatslacker commented 8 years ago

@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.

alexklibisz commented 8 years ago

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.