obipawan / react-native-dash

A super simple <Dash /> component for react-native to draw customisable dashed lines
176 stars 63 forks source link

stylesStore is read-only #16

Closed luskin closed 6 years ago

luskin commented 6 years ago

Looks like there is a bug with RN 0.56.0.

simulator screen shot - iphone 6 - 2018-07-16 at 10 44 37

Could be due to the const in your code here?

const stylesStore = {}
export const getDashStyle = (props) => {
    const isRow = isStyleRow(props.style)
    const id = getDashStyleId(props, isRow)
    if (!stylesStore[ id ]) {
        stylesStore = {
            ...stylesStore,
            [ id ]: createDashStyleSheet(props, isRow),
        }
    }
    return stylesStore[ id ]
}
luskin commented 6 years ago

confirmed, changing to a var fixes this error. Opening a PR now.