Skip to content

Conversation

@matheussll
Copy link

No description provided.

@halileohalilei
Copy link

I need this PR as well. However I don't think it would work as it is since Props type does not have style in it. You can import StyleObj from react-native/Libraries/StyleSheet/StyleSheetTypes and pass it as a prop from the parent. Something like this:

...
import { type StyleObj } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';

...

type Props = {
  ...
  onCaptureFailure?: (e: Error) => void,
  style?: StyleObj
};

...

export default class ViewShot extends Component {
...
  render() {
    const { children } = this.props;
    return (
      <View ref={this.onRef} collapsable={false} onLayout={this.onLayout} style={this.props.style}>
        {children}
      </View>
    );
  }
...

@gre
Copy link
Owner

gre commented Feb 6, 2018

I think it's ok not to type it. sorry, i totally missed the PR

@gre gre merged commit 7dd5c76 into gre:master Feb 6, 2018
@systemride
Copy link
Contributor

Hello, it would be nice if we could still add type defs 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants