Files
react-native/ReactCommon/fabric/components/view/ViewComponentDescriptor.h
T
Joshua Gross c75e8ae4ff LayoutAnimations: allow Paragraph props to be interpolated
Summary:
1. Split out the prop interpolation function out of the View ComponentDescriptor, into an inline'd function that can be used elsewhere.
2. Call it from View and from Paragraph component descriptors.

This causes animations including Text to look normal on iOS.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21675804

fbshipit-source-id: c34a317749fd6c108aef072d47f3dcb14ce8aa5c
2020-05-20 19:45:51 -07:00

39 lines
1.0 KiB
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/view/ViewShadowNode.h>
#include <react/core/ConcreteComponentDescriptor.h>
#include "ViewProps.h"
#include "ViewPropsInterpolation.h"
namespace facebook {
namespace react {
class ViewComponentDescriptor
: public ConcreteComponentDescriptor<ViewShadowNode> {
public:
ViewComponentDescriptor(ComponentDescriptorParameters const &parameters)
: ConcreteComponentDescriptor<ViewShadowNode>(parameters) {}
virtual SharedProps interpolateProps(
float animationProgress,
const SharedProps &props,
const SharedProps &newProps) const override {
SharedProps interpolatedPropsShared = cloneProps(newProps, {});
interpolateViewProps(
animationProgress, props, newProps, interpolatedPropsShared);
return interpolatedPropsShared;
};
};
} // namespace react
} // namespace facebook