useXPath

Type: Function

How to get useXPath?

JavaScript

import useXPath from 'fontoxml-fx/src/useXPath.js'

A React hook which runs the given XPath expression on the given context and observes the result. Whenever one of the inputs changes or whenever the result of the current inputs change, the result is recomputed and returned.

Arguments

  1. expression

    (Required)

    Type: String

    The XPath expression to evaluate.

  2. context

    (Required)

    Type: Object | NULL

    The context for the XPath expression.

    Default value

  3. options

    (Optional)

    Type: Object

    Properties

    Default value

Returns

Type: any | NULL

The result of the given XPath expression in the given returnType.