Recond makes react conditional render flexible. It is closer to if else statements.
Renders CondOne.
<Recond
methods={{
CondOne: () => "Hello!",
CondTwo: () => "Hey.",
}}
conditions={{
CondOne: true,
CondTwo: true,
}}
/>
Renders CondTwo.
<Recond
methods={{
CondOne: () => "Hello!",
CondTwo: () => "Hey.",
}}
conditions={{
CondOne: false,
CondTwo: true,
}}
/>
If doesnt match any condition, you can use defaultValue. Now defaultValue is rendered.
<Recond
methods={{
CondOne: () => "Hello!",
CondTwo: () => "Hey.",
}}
conditions={{
CondOne: false,
CondTwo: false,
}}
defaultValue="Hey, this is default value"
/>