Skip to content

Instantly share code, notes, and snippets.

View georgebutter's full-sized avatar
👻

George Butter georgebutter

👻
  • Mindfulness.com
  • Melbourne
View GitHub Profile
@georgebutter
georgebutter / Sanity custom, Typescript Sanity input
Created July 13, 2021 20:09
Example of a custom, typescript, sanity input that allows the user to select from a list of values retrieved from an external API
import * as React from "react";
import FormField from 'part:@sanity/components/formfields/default'
import SearchableSelect from 'part:@sanity/components/selects/searchable'
import {PatchEvent, set, unset} from 'part:@sanity/form-builder/patch-event'
const externalAPI = async (query: string) => {
return ["foo", "bar"]
}
export const MeditationInput: React.FC<Props> = (props) => {