Blog>
Snippets

Initializing TanStack Config in a React Application

Showcase the initial setup of TanStack Config in a React project, including library installation and basic configuration schema setup.
import { createConfig } from '@tanstack/config';
Importing the 'createConfig' function from the @tanstack/config package.
const appConfig = createConfig({
  initialConfig: {
    theme: 'light',
    apiUrl: 'https://api.example.com'
  }
});
Creating a basic configuration for the application, specifying an initial theme and API URL.