New in 1.41.0 (BETA)

useData()

Returns a DataScope from the current data.

Returns

DataScope – A DataScope from the current data.

Current data is mostly set automatically by the SDK, based on the particular structure and DataLocators of the content in question, but it can also be provided using the Scrivito.ContentTag component with a dataContext prop.

If there is no current data available, then an empty scope is returned.

Note that the returned DataScope can be a single-item scope. In order to check if a DataScope is a single-item scope, DataScope#isDataItem is available: