React Native uses modern JavaScript (ES6+) and JSX (HTML-like syntax inside JS). Here's the core.
Modern JS
const name = 'Anand'; // const = constant
let count = 0; // let = changeable
const add = (a, b) => a + b; // arrow function
const { id, title } = product; // destructuring
const items = [...list, newItem]; // spread
JSX
JSX lets you write UI like markup. Use { } to embed JavaScript.
function Price({ amount }) {
return <Text>{amount === 0 ? 'Free' : `\u{20B9}${amount}`}</Text>;
}
- Components must return a single root element (wrap siblings in a View or
<>…</>). - Use
{condition &&for conditional UI.} - Render lists with
array.map().
Summary
Master const/let, arrow functions, destructuring, spread and JSX — the everyday language of React Native.