getInitialData method

JSAny? getInitialData(
  1. int viewId
)

Returns the initialData configuration value passed from JS when viewId was added.

Developers can access the initial data from Dart in two ways:

  • Defining their own staticInterop class that describes what you're passing to your views, to retain type safety on Dart (preferred).
  • Calling NullableUndefineableJSAnyExtension.dartify and accessing the returned object as if it were a Map (not recommended).

Implementation

JSAny? getInitialData(int viewId) {
  return _viewManager.getOptions(viewId)?.initialData;
}