mirror of
https://github.com/hanzoai/yoga.git
synced 2026-10-30 19:34:29 +00:00
Summary:
Two small fixes to code examples in the documentation:
- **`external-layout-systems.mdx`:** The C/C++ tab declares `Widget widget{};` on line 24 but then references `&w` on line 26. Fixed to `&widget` to match the declared variable. The Java tab already uses the correct name (`widget`).
- **`incremental-layout.mdx`:** The JavaScript tab uses `void applyLayout(node) {` which is not valid JavaScript syntax. Fixed to `function applyLayout(node) {`. This appears to have been introduced in https://github.com/facebook/yoga/issues/1631 when the JS example was added by adapting the Java tab — other language-specific syntax was updated (`int` → `let`, type annotations removed) but the `void` return type was not changed to `function`. The code block is tagged as ` ```javascript ` and all other lines use valid JS syntax, confirming this was a copy-paste oversight rather than intentional pseudocode.
Pull Request resolved: https://github.com/facebook/yoga/pull/1926
Reviewed By: NickGerleman
Differential Revision: D100143877
Pulled By: fabriziocucci
fbshipit-source-id: 6d7a88d044ca369fa69046beb58c2e5f1256a27c