How to use the fbt._param function in fbt

To help you get started, we’ve selected a few fbt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookincubator / fbt / runtime / shared / fbs.js View on Github external
_param(label: string, value: $FbsParamInput, variations: [number, number]) {
    // TODO(T36305131) Returning implicit Flow type until fbt.js is typed properly
    invariant(
      typeof value === 'string' || value instanceof FbtPureStringResult,
      'Expected fbs parameter value to be the result of fbs(), , or a string; ' +
        'instead we got `%s` (type: %s)',
      value,
      typeof value,
    );
    // $FlowFixMe TODO(T36305131) Add accurate flow types to fbt.js
    return fbt._param(...arguments);
  },