react / react/yoga

setBaselineFunction not working in JavaScript

Open
#591 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Report

Issues and Steps to Reproduce

Replaces this with steps to repro your issue.

setBaselineFunction doesn't seem to be available in JavaScript build.

In the Java and C# builds you can set a baseline function like this (copied from YogaNodeTest.java:

child2.setBaselineFunction(new YogaBaselineFunction() {
      public float baseline(YogaNode node, float width, float height) {
            return 0;
      }
});

Expected Behavior

Describe what you expected would happen.

Ability to set function in JS, e.g. by using child2.setBaselineFunction((node, width, height) => 80);

Actual Behavior

Describe what actually happened.

Error is thrown TypeError: child2.setBaselineFunction is not a function

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 by comparing the Java and C# baseline-function APIs, including YogaNodeTest.java, with the JavaScript build entry point for setBaselineFunction. Expose equivalent JavaScript behavior for the callback described in the issue and verify that child2.setBaselineFunction no longer throws a TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.