setFlexBasisAuto is not a function #766

Closed
opened 2018-05-07 22:07:16 -07:00 by samwalshnz · 3 comments
samwalshnz commented 2018-05-07 22:07:16 -07:00 (Migrated from github.com)

Issues and Steps to Reproduce

  1. npm install yoga-layout
  2. Attempt to call node.setFlexBasisAuto() - where node is a Node instance

Expected Behavior

Should set the flex basis to auto

Actual Behavior

Error: node.setFlexBasisAuto is not a function

Note that the setFlexBasisAuto function is missing from entry-common.js

# Issues and Steps to Reproduce 1. `npm install yoga-layout` 2. Attempt to call `node.setFlexBasisAuto()` - where `node` is a `Node` instance # Expected Behavior Should set the flex basis to auto # Actual Behavior Error: `node.setFlexBasisAuto is not a function` Note that the [setFlexBasisAuto function is missing from entry-common.js](https://github.com/facebook/yoga/blob/master/javascript/sources/entry-common.js#L181)
samwalshnz commented 2018-05-07 22:19:45 -07:00 (Migrated from github.com)
Pull Request: https://github.com/facebook/yoga/pull/767
samwalshnz commented 2018-05-08 14:11:06 -07:00 (Migrated from github.com)

Note: For now, until setFlexBasisAuto is added like the other functions, I've discovered the following alternative:

import yoga, {Node} from 'yoga-layout';

const node = Node.create();
node.setFlexBasis(yoga.UNIT_AUTO)
Note: For now, until `setFlexBasisAuto` is added like the other functions, I've discovered the following alternative: ``` import yoga, {Node} from 'yoga-layout'; const node = Node.create(); node.setFlexBasis(yoga.UNIT_AUTO) ```
zythum commented 2022-10-09 23:22:22 -07:00 (Migrated from github.com)

For now, set NaN instead. it worked for me.

if (flexBasisValue ===  'auto') {
  node.setFlexBasis(NaN)
}
For now, set `NaN` instead. it worked for me. ``` if (flexBasisValue === 'auto') { node.setFlexBasis(NaN) } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#766
No description provided.