root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 390 forks source link

Error: Unsupported layout animation createConfig property (null) #2

Closed timdoes closed 9 years ago

timdoes commented 9 years ago

Hi,

When I close the drawer and replace the Navigator route at the same time, I get this error: Unsupported layout animation createConfig property (null)

Here are the contents of my method:

    this.refs.controlPanel.closeDrawer();
    this.refs.navContainer.replace({
      component: LoginView,
      navigationBar: <NavigationBar
        backgroundColor='#0077BF'
        title={data.viewTitle}
        titleColor='#FFFFFF'
        customPrev={data.customPrev}
      />,
      passProps: {foo: 'bar'},
    });

I'm not sure if this is a react-native issue or a rn-drawer issue so I thought I'd ask you here first.

Thanks for the help, -Tim

rt2zz commented 9 years ago

Interesting, I will need to look into it. Perhaps LayoutAnimation is unable to handle nested animations.

Regardless, LayoutAnimation is probably too limited for rn-drawer (cannot animate opacity for example) so I want to try replacing it with a raf/tweenState solution which will probably solve the error above.

rt2zz commented 9 years ago

what version of react-native are you on?

timdoes commented 9 years ago

Version 0.4.0

rt2zz commented 9 years ago

The state of animations in react-native appears to be in flux. For now I am adding setTimeout(fn, 0) which fixes the problem, albeit inelegantly. In the future I will reconsider other animation options.

Just pushed v0.0.6, let me know if that fixes it for you

timdoes commented 9 years ago

Thank you very much. This fixed the issue.