babel-plugin-flow-onlyupdateforkeys
A babel plugin to generate args of recompose.onlyUpdateForKeys
from flow type.
It is intended to be an alternative to recompose.onlyUpdateForPropTypes
for flow type.
Example
In
// @flow;; // without args { const foo bar = props; return <div>foo-bar</div> ;};
Out
// @flow;; // with args { const foo bar = props; return <div>foo-bar</div> ;};
Installation
$ npm install --save-dev babel-plugin-flow-onlyupdateforkeys
Usage
.babelrc
(Recommended)
Via .babelrc
Via CLI
$ babel --plugins flow-onlyupdateforkeys script.js
Via Node API
;
Using with flow-runtime
Note that when using this plugin with flow-runtime, you must ensure that babel-plugin-flow-onlyupdateforkeys is included before babel-plugin-flow-runtime.
.babelrc