Skip to content

nathanharper/babel-plugin-react-deferred-children

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-react-deferred-children

Defer the evaluation of children for specific React components without function syntax.

Installation

In your babel config:

plugins: [
    ["react-deferred-children", {
        "elements": [ "Loader", "If" ]
    }]
]

What it does

In:

<If condition={false}>
    <ComponentThatWillBreakUnderCertainConditions />
</If>

Out:

<If condition={false}>
    {() => <ComponentThatWillBreakUnderCertainConditions />}
</If>

About

Defer the evaluation of children for specific React components without function syntax.

Resources

License

Stars

Watchers

Forks

Packages

No packages published