Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp component base.dynamicproperty.trygetvalue

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-component-base > DynamicProperty > tryGetValue

DynamicProperty.tryGetValue() method

Returns the value of the object.

Signature:

tryGetValue(): TValue | undefined;

Returns:

TValue | undefined

the value associated with the dynamic property or undefined if the source or the data doesn't exist.

Remarks

If the value is an array, then the first element of the array is returned; otherwise, the value itself is returned.

NOTE: This api will never return an array. To retrieve an array value, use the DynamicProperty.tryGetValues() API.

Clone this wiki locally