ScrollViewShadowNode.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <react/components/scrollview/ScrollViewEventEmitter.h>
  9. #include <react/components/scrollview/ScrollViewProps.h>
  10. #include <react/components/scrollview/ScrollViewState.h>
  11. #include <react/components/view/ConcreteViewShadowNode.h>
  12. #include <react/core/LayoutContext.h>
  13. namespace facebook {
  14. namespace react {
  15. extern const char ScrollViewComponentName[];
  16. /*
  17. * `ShadowNode` for <ScrollView> component.
  18. */
  19. class ScrollViewShadowNode final : public ConcreteViewShadowNode<
  20. ScrollViewComponentName,
  21. ScrollViewProps,
  22. ScrollViewEventEmitter,
  23. ScrollViewState> {
  24. public:
  25. using ConcreteViewShadowNode::ConcreteViewShadowNode;
  26. #pragma mark - LayoutableShadowNode
  27. void layout(LayoutContext layoutContext) override;
  28. Transform getTransform() const override;
  29. private:
  30. void updateStateIfNeeded();
  31. };
  32. } // namespace react
  33. } // namespace facebook