-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored animations to work in iOS and Android. Breaking changes #42
base: master
Are you sure you want to change the base?
Conversation
Works great for me! Thx! |
You have a small bug that expanded prop (If the accordion is expanded by default when mounted.) doesn't work..to fix this: getInitialState() {
return {
is_visible: false, // change false to this.props.expanded
height: null,
content_height: 0
};
}, |
Fixed. Thanks! |
I'm getting cannot read property 'nativeEvent' of undefined. on line 73 That's when my view get loaded. If I dismiss the error I can interract with the accordion? Any ideas? I just copied the modified accordion to my installation. Do I need to do anything else? |
@compojoom It could be a race condition. From the documentation for
I'm wondering if it's possible that something else is slowing it down so much that the onLayout is called before the component is rendered. Could you provide more information like what version of RN you're using, platform, os version, etc? |
Thanks for taking the initiative @thireven! Is this in a good state to be reviewed or are you still addressing bugs? |
…een-state. Animations now work on Android. Updated RN version and iOS example.
I believe it's in a good state to be reviewed. Haven't personally run into any other bugs. |
I just tried it again and this time it seems to work. Not sure what I've done wrong last time. |
I was too fast. So upon reloading my js(not jut hot loading) I get the same error as before. I'm trying this with RN 0.36 |
I'm trying to debug what's wrong but so far without success. It seems that in my case render get's called twice and this calls _getContentHeight twice. The first time the event is undefined, the second time the event is correct. So adding a check if the event is defined solved that for me. However I have another issue. In my case the content can be dinamic. If the accordion is open, when I add a new item to the content I need to recalculate the height. I can't figure out how to do that with the current modifications. In the past I was able use willReceiveProps and call _getContentHeight from there, but with your modifications _getContentHeight now expects an event and I can't pass one. Ideas? |
@compojoom I'm not able to reproduce the behavior you're describing with the Accordion example. Could you update the example to replicate your issue and post the code here? |
Any ETA for when this is going to be merged? I really would like to remove the dependency on react-tween-state package |
This project hasn't been updated in almost a year. it seems abandoned. |
Fixes for PropTypes and React.createClass deprecation changes in Reac…
Replaced react-tween-state with native Animated library so that the animations work in both iOS and Android. For this reason, there is one breaking change: the
easing
property no longer takes a string, but an Easing function.