Skip to content

fabrianibrahim/react-conditional-rendering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React IF Conditional Rendering

Examples

...

return (
    <If condition={isLoading}>
        <Loading />
    <Else>
        <Content />
    </Else>
    </If>
);
...

return (
    <If condition={data === 'x'}>
        <h1>Title1</h1>
        <ElseIf condition={data === 'y'}>
            <h1>Title2</h1>
        </ElseIf>
        <Else>
            <h1>Title3</h1>
        </Else>
    </If>
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published