Comments (6)
@grabbou I've been thinking about this and I think we'll need to setup a prepublish script which transpiles these flow annotations to propTypes before publishing
from react-native-paper.
However, we shouldn't get rid of PropTypes, because not everyone uses Flow, so runtime warnings will be useful for them.
Wouldn't a babel plugin to rewrite flow types to prop types solve that problem? That way, we could reduce the overheat of keeping two ways of describing the components API in favour of a single source of truth. The problem that I see here is that both of these provide a slightly different syntax for describing things like lists, arrays or optional values and it's rather easy to provide inconsistencies.
Here's a reference implementation: https://github.com/brigand/babel-plugin-flow-react-proptypes
from react-native-paper.
@satya164 I think you're more eligible to answer that
from react-native-paper.
Flow is certainly superior because it'll provide static type checking and autocompletion. It's also much easier to grasp than prop types in terms of documenting code. It can be used on the CI to prevent unintentional bugs.
However, we shouldn't get rid of PropTypes, because not everyone uses Flow, so runtime warnings will be useful for them.
I think we need to enforce both Flow and PropTypes for now. We should setup CI so that we don't break Flow on master.
from react-native-paper.
Does this need to be open? @satya164
from react-native-paper.
We've not arrived at a conclusion, so yes.
from react-native-paper.
Related Issues (20)
- (Flat TextInput) - Input Text color is not matching with MD3 design HOT 1
- TextInput render prop don't show full label HOT 11
- (Flat TextInput) - Input Text Underline color is not matching with MD3 design HOT 1
- [Feature request] Add Material Extended FAB HOT 1
- TextInput:Android values is getting clipped from left HOT 1
- CheckboxAndroid and CheckboxIOS use MaterialCommunityIcon instead of custom icon function from PaperProvider
- DropDowns and DatePickers
- [Feature request] Add Material Date Pickers
- Is it possible to control the borderRadius of animatedFAB?
- React Native Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'o.default.Item') HOT 2
- https://callstack.github.io/react-native-paper is not working HOT 3
- Is it possible to style button's hover shadow in SegmentedButtons? HOT 1
- Button and IconButton TouchableRipple borderRadius is calculated from the icon size and not the button borderRadius HOT 3
- Add keepMounted flag to Modal/Dialog
- Alignment issue when onPress is used in TextInput.Affix HOT 1
- [Feature request] Add Material Time Pickers
- [Feature request] Add Material Sliders / Range sliders
- [Feature request] Add Material Tabs
- [Feature request] Add Material Rich Tooltips
- Using Chip results into error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-paper.