Closed dingbat closed 7 years ago
@RealOrangeOne Lint wanted it written as a stateless function. Let me know what you think.
@dingbat I understand why. Instead of adding the keys after the fact, could you use the static
block in a component to define them, would be much easier, and it shouldnt complain then
@RealOrangeOne I'm not sure what you meant by using a static
block, but I added the constants as static fields on the component class. Thanks for the good feedback.
Almost done. Can you remove the brackets around the fat-arrow functions, keep things a little cleaner, as they aren't needed. Then we can ship! :shipit:
Oh, the parentheses? They are needed because the functions return an empty object, so it's ambiguous with the omitted-bracket function syntax.
Actually now that I think about it, the library doesn't call the functions, it just references/asserts that they're present, so we could even just do:
static CardStackPanResponder = CardStackPanResponder;
static CardStackStyleInterpolator = {
forHorizontal: {},
forVertical: {},
};
static PagerPanResponder = PagerPanResponder;
static PagerStyleInterpolator = {
forHorizontal: {},
};
ah, didnt realise they were returning empty objects. thought they werent returning. In that case! :shipit:
Currently any use with react-router-native fails because it expects several classes/functions to be defined on
NavigationExperimental.Card
(see in react-native here).It also expects
forHorizontal
andforVertical
inCardStackStyleInterpolator
andforHorizontal
inPagerStyleInterpolator
, all on load.This PR adds all those mocks to the existing NavigationExperimental mock.
Thanks for the hard work put into this library!