Summary: Remove some outdated information and make sure that npmjs shows the builtin TypeScript typings (now that we no longer have clever resolution schemes). Reviewed By: javache Differential Revision: D54788636 fbshipit-source-id: 76e7663924189fd68ac62b27730f44213b13ad85
32 lines
619 B
Markdown
32 lines
619 B
Markdown
# yoga-layout
|
|
|
|
This package provides prebuilt WebAssembly bindings for the Yoga layout engine.
|
|
|
|
See more at https://yogalayout.dev
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import {Yoga, Align} from 'yoga-layout';
|
|
|
|
const node = Yoga.Node.create();
|
|
node.setAlignContent(Align.Center);
|
|
```
|
|
|
|
Objects created by `Yoga.<>.create()` are not automatically garbage collected and should be freed once they are no longer in use.
|
|
|
|
```ts
|
|
// Free a config
|
|
config.free();
|
|
|
|
// Free a tree of Nodes
|
|
node.freeRecursive();
|
|
|
|
// Free a single Node
|
|
node.free();
|
|
```
|
|
|
|
## Requirements
|
|
|
|
`yoga-layout` requires a toolchain that supports ES Modules and top-level await.
|