Skip to content
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

Add basic API for custom components #2

Merged
merged 3 commits into from
Sep 2, 2022
Merged

Add basic API for custom components #2

merged 3 commits into from
Sep 2, 2022

Conversation

j-piasecki
Copy link
Owner

Description

This PR adds a simple API for creating custom components:

  • components with type Custom are treated like Stack when measured, and its children are positioned at the top-start.
  • Custom function accepts additional argument with custom config
  • custom config may be used to store data between updates
  • custom config may additionally contain hooks for specific moments:
    • dropHandler - invoked when the node is dropped from the tree
    • createView - invoked when the view enters the view hierarchy, when implemented it must return a reference to the created view
    • overrideViewProps - invoked after the ViewManager finishes setting up the newly created view, it may be used to overwrite them
    • updateView - invoked during update, receives previous and the next node
    • deleteView - invoked when the view leaves the view hierarchy, when implemented it must delete the created view (note that this method may be called without calling dropHandler to reorder views)

@j-piasecki j-piasecki merged commit beaa23c into main Sep 2, 2022
@j-piasecki j-piasecki deleted the custom-views branch September 2, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant