Skip to content

Conversation

@usrbowe
Copy link
Contributor

@usrbowe usrbowe commented Jun 3, 2018

Description

Fix #3
allow only supported react-native stylesheet values.

Example

If we pass: text-align: start, it will get through validation, but it will fail to render, since RN does not support start.

validation rules based on RN doc spec, prevents crashing on unsupported style values
@usrbowe usrbowe added the enhancement New feature or request label Jun 3, 2018
@usrbowe usrbowe self-assigned this Jun 3, 2018
@usrbowe usrbowe requested a review from satya164 June 3, 2018 12:52
@satya164
Copy link
Contributor

satya164 commented Jun 3, 2018

Currently, it's using propTypes to filter things. So you can write a custom version of checkPropTypes to do the filtering instead of hardcoding the list: https://github.com/facebook/prop-types/blob/master/checkPropTypes.js

@usrbowe usrbowe changed the base branch from master to develop June 9, 2018 08:14
@usrbowe
Copy link
Contributor Author

usrbowe commented Sep 26, 2018

missing validation for Layout Props: https://facebook.github.io/react-native/docs/layout-props

@usrbowe
Copy link
Contributor Author

usrbowe commented Sep 26, 2018

possible better to check against value validation defined here: https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js (for text, view)

Update:
Can't directly use PropTypes itself, so custom version of checkPropTypes would be way to go.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants