Skip to main content

Basic usage

This is the basic example of using <Autoview /> component.

Most of the work in this example is happening in the repo.tsx file, where you bind components to the JSONSchema data types.

Further examples will extend this one or will use amazing repo composition features.

import React from 'react';
import {
    RepositoryProvider,
    AutoView,
    CoreSchemaMetaSchema
} from '@autoviews/core';

import {data} from './data';
import schema from './schema.json';
import {repo} from './repo';

export default function App() {
    return (
        <RepositoryProvider components={repo}>
            <AutoView
                schema={schema as CoreSchemaMetaSchema}
                data={data}
            />
        </RepositoryProvider>
    );
}