G
G
GaserV2018-06-28 15:55:52
React Native
GaserV, 2018-06-28 15:55:52

How to use classnames in React Native?

Hello! Such a problem. Created a project on React Native + sass. Connected classnames . Imported root sass and it works. But it’s not so easy with classnames, they don’t plow. The class is added but there are no styles. Who has had experience with this? plz share how to befriend them

import * as React from 'react'
import classNames from 'classnames/bind'
import styles from './index.sass'

const cx = classNames.bind(styles)

const HomePage = () => (
    <div className={cx('some')}>
        'Home page'
    </div>
)

export default HomePage

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nick, 2018-07-19
@DragonSpirit

There is no div block in react native, are you confusing the question category with the usual react?

V
vimirtv, 2018-08-04
@vimirtv

Instead of div use
<View><Text>Home page </Text></View>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question