簡體   English   中英

如何格式化原子中的原子代碼

[英]How to format code of react native in atom

我正在研究react-native app。 我正在使用atom文本編輯器來開發react-native應用程序。

我沒有找到任何在atom中格式化react-native代碼的快捷方式。 我試過美化包https://atom.io/packages/atom-beautify,但它無法正常工作。

import React, {
    Component
} from 'react';
import {
    AppRegistry,
    Image,
    View,
    Text,
    Button,
    StyleSheet
} from 'react-native';

class SplashScreen extends Component {
    render() {
        return ( <
            View style = {
                styles.container
            } >
            <
            Image source = {
                require('./img/talk_people.png')
            }
            style = {
                {
                    width: 300,
                    height: 300
                }
            }
            /> <
            Text style = {
                {
                    fontSize: 22,
                    textAlign: 'center',
                    marginTop: 30
                }
            } > Never forget to stay in touch with the people that matter to you. < /Text> <
            View style = {
                {
                    marginTop: 30
                }
            } > < Button title = "CONTINUE"
            color = "#FE434C" / > < /View> <
            /View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: '#FFFFFF',
        margin: 50,
        alignItems: 'center',
        flex: 1,
        flexDirection: 'column'
    }
})

AppRegistry.registerComponent('Scheduled', () => SplashScreen);

我強烈推薦更漂亮的原子

漂亮的人最近得到了很多關注,這是有充分理由的。

這是一個非常直接的,固執己見的JavaScript格式化程序,具有適合您風格的有限選項。 如果您需要更多控制,它還帶有可選的ESLint集成。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM