ink-step
Manage Ink app step by step. inspired by react-router.
Install
$ npm install --save ink-step
Getting Started
const h render Component Color = ;const Step To TaskProvider createStepHistory = ;// Welcome step Component{super...args;thisstate =welcome: true;}{}{if !thisstatewelcomereturn <To task='main' />return<Color blue>Welcome to Step!</Color>}// Main step Component{return <Color green>This is Ink-step</Color>}// create step historyconst history =const App =<div><Step task='welcome' render= <WelcomeStep /> /><Step task='main' render= <MainStep />/></div>// Provider must have root child.;
API
TaskProvider
const history =<TaskProvider history=history><MyApp /></TaskProvider>
Step
<Step task='welcome' render= <WelcomeStep /> />// or<Step task='welcome'> <WelcomeStep /></Step>
To
<To task='welcome' />
createStepHistory
const createStepHistory = ;const history = ;