import React from 'react';
import {If, Then, Else} from 'react-render-flow';
function App() {
return (
<If condition={user.id === loggedUser.id}>
<Then>
Condition is true
</Then>
<Else>
Condition is false
</Else>
</If>
)
}
Props
Name
Type
condition
boolean
Switch statement
import React from 'react';
import {Switch, Case, Default} from 'react-render-flow';
function App() {
return (
<Switch when={user.role}>
<Case is="super-admin">
Show super admin content
</Case>
<Case is="admin">
Show admin content
</Case>
<Case is="editor">
Show editor content
</Case>
<Default>
Show user content
</Default>
</If>
)
}