Posts

Showing posts with the label php

101-various

  1 ) Import Export more than two entities: https://stackoverflow.com/questions/46039976/exporting-multiple-modules-in-react-js 1.1) in CarNs.jsx export function Garage.... export class CarN 1.2) in App.jsx import { CarNs, Garage } from './components/CarNs.jsx'; 1.3) Render multiple entities : class and function together in App.jsx : root.render( <> <CarNs color="red"/> <Garage /> </> ); 2/Other programming 2.1/embed JavaScript expressions Because of JSX, you can also embed JavaScript expressions inside an element by using curly brackets  {} : const lowercaseClass = 'text-lowercase'; const text = 'Hello World!'; const App = <h1 className= {lowercaseClass} > {text} </h1>; This is what makes React elements different from HTML elements. You can't embed JavaScript directly by using curly braces in HTML. 2.2/Fragment <> or   < Fragment >  The empty tag is a React feature called a  Fragment . By using a Fra...