react / react/yoga

How to tell Yoga to update layout from native Fabric component size

Open
#1,789 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18.9k
Forks
1.6k
Avg merge
1m
Merged PRs (30d)
1

Description

I've been trying to build a fabric native component and have it layout without requiring manual sizing from react, but I'm not able to find example or solution for this problem. I tried manually updating the frame of the contentView, but yoga seems to ignore it. React will render it, but next elements position will be 0,0.

Take this example for example https://github.com/reactwg/react-native-new-architecture/blob/main/docs/fabric-native-components.md, how would one modify it to not have a specific height in react and instead infer it from its children sizing ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Fabric native components example linked in the issue and trace how child sizing is supplied when the React height is omitted. Compare that behavior with Yoga's layout update path and document or reproduce the required integration; done means a child-sized component lays out following elements at the expected position without manual React sizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.