Lint rule react prop types addition
This commit is contained in:
committed by
Sofiya Tepikin
parent
8444d466db
commit
47379d7a1e
@@ -1,4 +1,5 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Hyperlink from 'react-native-hyperlink'
|
||||
import styles from '../styles'
|
||||
import links from '../i18n/en/links'
|
||||
@@ -15,6 +16,13 @@ export default function Link(props) {
|
||||
)
|
||||
}
|
||||
|
||||
Link.propTypes = {
|
||||
children: PropTypes.oneOfType([
|
||||
PropTypes.arrayOf(PropTypes.node),
|
||||
PropTypes.node
|
||||
])
|
||||
}
|
||||
|
||||
function replaceUrlWithText(url) {
|
||||
const link = Object.values(links).find(l => l.url === url)
|
||||
return (link && link.text) || url
|
||||
|
||||
Reference in New Issue
Block a user