Reduce size of API; remove helpers

This commit is contained in:
Nicolas Gallagher
2015-09-01 14:43:05 -07:00
parent 000bbf9f93
commit d3dce675df
4 changed files with 2 additions and 51 deletions

View File

@@ -112,40 +112,6 @@ const buttonStyle = {
}
```
The styling strategy can be applied directly to non-SDK elements:
```js
import { stylingStrategy } from 'react-web-sdk';
class Example extends React.Component {
render() {
return (
<div {...stylingStrategy({
style: {
opacity: 0.5
}
})} />
);
}
}
```
## Utilities
#### `getOtherProps(reactComponentInstance)`
Returns an object containing all the props from `this.props` that are not
defined in `propTypes`.
#### `omitProps(obj, arrayOfExcludedProps)`
Returns an object with the specified props excluded.
#### `pickProps(obj, arrayOfIncludedProps)`
Returns an object with the specified props included.
## Development
```

View File

@@ -1,17 +1,9 @@
import React from 'react';
import { Image, Text, TextInput, View, stylingStrategy } from '../dist/main';
import React, { Image, Text, TextInput, View } from '../dist/react-native-web';
class Example extends React.Component {
render() {
return (
<View>
<div {...stylingStrategy({
style: {
backgroundColor: '#000',
height: '10px',
opacity: '0.5'
}
})} />
<View style={styles.grid}>
{[1,2,3,4,5,6].map((item, i) => {
return (

View File

@@ -1,6 +1,5 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../dist/react-web-sdk.css">
<div id="react-root"></div>
<script src="../dist/example.js"></script>

View File

@@ -1,20 +1,14 @@
import React from 'react';
import { omitProps, pickProps } from './modules/filterObjectProps';
// components
import Image from './modules/Image';
import Text from './modules/Text';
import TextInput from './modules/TextInput';
import View from './modules/View';
import { restyle } from './modules/react-native-web-style';
export default React;
export {
// helpers
omitProps,
pickProps,
restyle,
// components
Image,
Text,
TextInput,