generateJsProps function

JsMap generateJsProps(
  1. Map props, {
  2. bool convertRefValue = true,
  3. bool convertCallbackRefValue = true,
  4. List<String> additionalRefPropKeys = const [],
  5. bool wrapWithJsify = true,
})

Converts props into a JsMap that can be utilized with React.createElement().

Implementation

JsMap generateJsProps(Map props,
    {bool convertRefValue = true,
    bool convertCallbackRefValue = true,
    List<String> additionalRefPropKeys = const [],
    bool wrapWithJsify = true}) {
  final propsForJs = JsBackedMap.from(props);
  if (convertRefValue) {
    convertRefValue2(propsForJs,
        convertCallbackRefValue: convertCallbackRefValue, additionalRefPropKeys: additionalRefPropKeys);
  }

  assert(!mapHasCallbackRefWithDefinitelyNonNullableArgument(propsForJs), nonNullableCallbackRefArgMessage);

  return wrapWithJsify ? jsifyAndAllowInterop(propsForJs) as JsMap : propsForJs.jsObject;
}