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

Use compose to render Switch in Fabric #32871

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShikaSD
Copy link
Contributor

@ShikaSD ShikaSD commented Jan 11, 2022

Summary:
This change is a proof of concept to try Compose integration with RN component on Android by measuring and drawing Switch component through a Composable function.

To interface Composable nodes with the view system, we use a "classic" view interoperability layer to plug Compose-based Switch into existing ViewManager and propagate props and events as we do with “classic” views.

Fabric also requires initial measure during layout, which was implemented through custom background Recomposer and LayoutNode hacks to avoid creating full-blown view.

Differential Revision: D31657259

Summary:
This change is a proof of concept to try Compose integration with RN component on Android by measuring and drawing Switch component through a Composable function.

To interface Composable nodes with the view system, we use a "classic" view interoperability layer to plug Compose-based Switch into existing ViewManager and propagate props and events as we do with “classic” views.

Fabric also requires initial measure during layout, which was implemented through custom background `Recomposer` and `LayoutNode` hacks to avoid creating full-blown view.

Differential Revision: D31657259

fbshipit-source-id: ad5d2434d8c783d03f93b829e46e7e09ef5c4564
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jan 11, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31657259

@ShikaSD
Copy link
Contributor Author

ShikaSD commented Jan 11, 2022

For reference: screencap + Flipper layout view

image (1)

@pull-bot
Copy link

Messages
📖

📋 Missing Changelog - Can you add a Changelog? To do so, add a "## Changelog" section to your PR description. A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against ac9eb36

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 0fccbd5
Branch: main

@github-actions
Copy link

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 11, 2022
@cortinico cortinico removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 16, 2022
@cortinico cortinico added the Never gets stale Prevent those issues and PRs from getting stale label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Never gets stale Prevent those issues and PRs from getting stale p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants