# contextRef

### Overview

`contextRef` is a [\<Feathery.Form>](https://docs.feathery.io/develop/react/api-guide/form) prop that will set the `current` property of a ref to an instance containing form state and functions useful for interacting with the form.

### Usage <a href="#usage" id="usage"></a>

You can set the current form step, update a field value, get the current step name, and more.

```typescript
import { useRef } from 'react';
import { init, Form, FormContext } from '@feathery/react';

function App() {
  // Initialize Feathery
  init('SDKKey', 'support@feathery.io');
  const context = useRef<FormContext>(null);

  // After the Form is rendered, and the ref is set, you can
  // access any of the properties listed below
  setTimeout(() => context.current.setStep('New Step'), 1000);

  // Show the `aBcDeF` Feathery form
  return <Form
    formId='aBcDeF'
    // Fetch the Feathery form context
    contextRef={context}
  />
}
```

### [Context API](https://docs.feathery.io/develop/context-api)
