This documentation describes unreleased changes on the main branch.

getData()

Function of @saij/wp-app-framework/view.

import { getData } from '@saij/wp-app-framework/view';
function getData(key: string): DataValue

A value of the view data of your theme or plugin, set in PHP with ViewData::set().

ParameterTypeDescription
keystringThe key of the value.

Returns DataValue: The value; an unknown key throws an error that names the known keys.