skt-t1-byungi / react-viewflow

A React component library for managing complex view flows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-viewflow

Work in progress

A React component library for managing complex view flows

Example

const PageFlow = viewflow(function* (flow) {
    while (true) {
        yield <Page1 onNext={() => flow.next()} />

        try {
            const result = yield (
                <Page2
                    onNext={() => flow.next(true)}
                    onBack={() => flow.next()}
                    onError={() => flow.throw()}
                />
            )

            if (result) break
        } catch {
            return <ErrorPage />
        }
    }

    return <SuccessPage />
})

About

A React component library for managing complex view flows


Languages

Language:TypeScript 83.1%Language:JavaScript 16.9%