Beta
Mapbox Search JS

Hooks

Public beta for Mapbox Search JS

Mapbox Search JS is in public beta. During the public beta phase, frameworks may be subject to potential changes as they stabilize.

useMapboxAutofill

A React hook that returns a MapboxAutofill instance.

Parameters

options(AutofillOptions)
NameDescription
options.accessToken
string

Returns

MapboxAutofill

useMapboxSearch

A React hook that returns a MapboxSearch instance.

Parameters

options(Options)
NameDescription
options.accessToken
string

Returns

MapboxSearch

useEvented

A React hook to register an event listener on a Search JS Core Evented object.

Evented is a base class that is inherited by SearchSession.

Parameters

evented((Evented<T> | null))
eventName(K)
cb(function (object: any): any)

Returns

void

useConfirmAddress

A React hook that returns a form ref and a function to show the address confirmation modal

Parameters

optionsArg(AddressConfirmOptions)(default {})

Returns

UseConfirmAddressObject