I am working on react-native
app. I am using atom
text editor for the development of react-native
apps.
I did not find any shortcut to format react-native
code in atom. I tried beautify package https://atom.io/packages/atom-beautify but it is not working.
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);
Format a selection of code using the code-format:format-code ( CTRL+SHIFT+C ) command. (Also accessible via context menu, or "Edit > Text > Format Code"). When no selection is provided, the entire file is formatted.
To Format text Using atom-beautify :Hit Ctrl + Alt + B ( Ctrl + Option + B on mac).
atom-react-native-css – It is a package to style React-Native components with built-in support for SASS/SCSS. React-native-css turns valid CSS/SASS into the Facebook subset of CSS. react-native-snippets – It is a package for React Native snippets for Atom.
Open Atom preferences and go to Install tab. Here you can search and install each of the packages mentioned below and get ready to code your mobile applications in React Native. I have tried to keep the plugins to minimum, so as not to clutter Atom.
I highly recommend prettier-atom.
Prettier has been getting a lot of attention lately, and for a good reason.
It's a very straight forward, opinionated JavaScript formatter with a limited set of options to suit your style. It also comes with an optional ESLint integration if you need more control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With