This is a <Feathery.Form> prop and callback function to run custom logic when a form step is loaded. It's called every time the user loads a step. This function can be asynchronous.


You can use onLoad to update internal form state, log events, etc.

import { Feathery } from 'feathery-react';
function App() {
// Initialize Feathery to Peter
Feathery.init('adminAPIKey', '');
// Show the `onboarding` Feathery form
return <Feathery.Form
// Custom form step load logic
onLoad={(context) => {
if (context.stepName === 'begin') context.setValues({'beginForm': True});
else if (context.stepName === 'next-step') logEvent("Loaded Step 2");

Context Properties#

fieldsfieldData objectThe data of all fields in the form.
stepNamestringThe unique ID of the step.
lastStepbooleanTrue when the step being submitted is the last step the user needs to complete.
setValuesfunctionPass in an object of the shape {<fieldKey>: <fieldValue>} to customize internal form state.
setOptionsfunctionPass in an object of the shape {<fieldKey>: [<fieldOption>]} to override the options a user can select for specific fields.

Return Value#

A promise can be optionally returned from this function if it's asynchronous and you want execution to await.