Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type Event = Object;
* ```
*/
var TextInput = React.createClass({
statics: {
/* TODO(brentvatne) docs are needed for this */
State: TextInputState,
},

propTypes: {
/**
* Can tell TextInput to automatically capitalize certain characters.
Expand Down
6 changes: 6 additions & 0 deletions Libraries/StyleSheet/StyleSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

var StyleSheetRegistry = require('StyleSheetRegistry');
var StyleSheetValidation = require('StyleSheetValidation');
var flattenStyle = require('flattenStyle');

/**
* A StyleSheet is an abstraction similar to CSS StyleSheets
Expand Down Expand Up @@ -59,6 +60,8 @@ var StyleSheetValidation = require('StyleSheetValidation');
* subsequent uses are going to refer an id (not implemented yet).
*/
class StyleSheet {
static flatten: typeof flattenStyle;

static create(obj: {[key: string]: any}): {[key: string]: number} {
var result = {};
for (var key in obj) {
Expand All @@ -69,4 +72,7 @@ class StyleSheet {
}
}

/* TODO(brentvatne) docs are needed for this */
StyleSheet.flatten = flattenStyle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to move this logic to React and decouple this from styles. The refactoring I've done has decoupled this logic from the style prop.

This is similar to the React.Children.toArray helper so something like that on React might make sense.

It doesn't really hurt to have it here too for now but I don't think it ultimately belongs here.


module.exports = StyleSheet;
2 changes: 2 additions & 0 deletions Libraries/react-native/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var ReactNative = Object.assign(Object.create(require('React')), {
// Components
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
ART: require('ReactNativeART'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, this will go into the react-art package and this will be removed, but since it depends on react we'll need to wait for #2985

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great to hear, I think that's the right place for it cc @ide

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's great. Would be good to get to a state where you pay for only what you use, for most of the components & modules.

DatePickerIOS: require('DatePickerIOS'),
DrawerLayoutAndroid: require('DrawerLayoutAndroid'),
Image: require('Image'),
Expand All @@ -43,6 +44,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {
TextInput: require('TextInput'),
ToastAndroid: require('ToastAndroid'),
ToolbarAndroid: require('ToolbarAndroid'),
Touchable: require('Touchable'),
TouchableHighlight: require('TouchableHighlight'),
TouchableNativeFeedback: require('TouchableNativeFeedback'),
TouchableOpacity: require('TouchableOpacity'),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"dependencies": {
"absolute-path": "^0.0.0",
"art": "^0.10.0",
"babel": "^5.8.23",
"babel-core": "^5.8.23",
"bser": "^1.0.2",
Expand Down