Managing React Form State Using the React-Form Library
Shopify's open source @shopify/react-form library, part of the Quilt repo, replaces hand-written useState and change handlers in a React form with the useForm and useField hooks. Building on a Polaris form, the tutorial wires each TextField to the fields object's value and onChange, then uses the hook-provided submit for form submission. It adds reset to clear the form after saving and dirty to keep the Save button disabled until input changes. It finishes with a notEmpty validator so the Title field is required.
Related posts
- Building a Form with Polaris
Shopify Engineering mediumAdeptA step-by-step tutorial builds a Shopify-style Add Product form using Polaris React components (Form, FormLayout, TextField, Page, Card). Along the way it shows why an AppProvider wrapper is required for global i18n context, and how to use FormLayout for spacing, Page props for breadcrumbs, title and primary actions, and Card's sectioned prop for padding. It then turns the form into a controlled React form with useState, onChange handlers and a submit handler wired to the Page's primary action.
- How Migrating from Vanilla Redux to Redux Toolkit Improved State Management in Shopify POS
Shopify Engineering mediumAdeptShopify's Point of Sale React Native app moved from vanilla Redux to Redux Toolkit over about three months. The team migrated reducer by reducer, relying on RTK slices and vanilla reducers coexisting in one root reducer so each change could ship and roll back independently. They adopted RTK's mutable slice syntax and generated action creators widely. For async logic they kept a hybrid createAsyncThunk pattern instead of extraReducers pending/fulfilled handlers, and skipped RTK Query because it lacks GraphQL support. The migration deleted about 3,500 lines of boilerplate, and the post flags two gotchas: type useDispatch, useSelector and useStore early, and use dispatch().unwrap() where code previously awaited dispatch.
- Shopify’s platform is the Web platform
Shopify Engineering mediumAdeptRemix is now Shopify's recommended framework for building Admin apps, backed by a rewritten, final version of App Bridge that makes cross-origin iframes behave like a normal web environment. App Bridge uses postMessage() to restore what browsers strip from iframes: it syncs history.pushState() URL changes to the top-level page, supplies OpenID Connect ID tokens in place of unavailable cookies, and exposes Admin integrations such as sidebar navigation through standard Custom Elements. It is loaded from a CDN script tag so fixes reach every app without redeploys. The Remix template bundles @shopify/shopify-app-remix for OAuth, ID token and HMAC handling, plus Prisma for storage and session persistence.
- Rapid Development with Hydrogen: Building a Product Page
Shopify Engineering mediumAdeptHydrogen, Shopify's React-based storefront framework, can produce a working product display page quickly by composing its built-in commerce components and hooks. The walkthrough starts from the Hello World template on StackBlitz, adds Tailwind CSS, and creates a dynamic `/products/[handle]` route via file-based routing. Product data comes from the Storefront API through `useShopQuery`. A client component wrapped in `ProductOptionsProvider` handles variant selection and price, while `BuyNowButton` and a media gallery component finish the page. It also shows where the server/client component split matters when state is needed.
- Upgrading Checkout Blocks app to Polaris web components
Shopify Engineering mediumAdeptShopify's Checkout Blocks team migrated five high-traffic checkout UI extensions from React and the legacy Remote UI bridge to Preact, remote-dom and Polaris web components, rewriting them in TypeScript, and cut transferred bundle sizes by 40-85% and extension load time by about 8% at P50. Most of the work went into fitting under the new 64KB gzip bundle limit. Dropping react-reconciler saved about 89KB, a custom AI-assisted Liquid parser validated against a 42,000-line production parity corpus replaced liquidjs, and markdown-to-jsx was kept by aliasing React to Preact. The team migrated one extension per day, smallest first, behind new success/failure metrics. That monitoring caught a useId() ID-collision bug, which was rolled back the same day, and the work also produced upstream Polaris component fixes.