This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _mergeArrays = (a, b) => { | |
const c = [] | |
while (a.length && b.length) { | |
if( a[0][0] == b[0][0] ) { | |
if( a[0][1] < b[0][1] ) { | |
c.push(a.shift()); | |
} else { | |
c.push(b.shift()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import "./App.css"; | |
import { BrowserRouter as Router, Route, Switch, Link } from "react-router-dom"; | |
function LandingView() { | |
return <div>LandingView</div>; | |
} | |
function Login() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import CompoC from "./CompC"; | |
import { UserProvider } from "./userContext"; | |
export default function App() { | |
return ( | |
<div> | |
<UserProvider value="ram"> | |
<CompoC /> | |
<CompD /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {View, ScrollView} from 'react-native'; | |
import {List, Divider, Colors} from 'react-native-paper'; | |
const vehicles = [ | |
{id: 1, no: 'AP28X1234'}, | |
{id: 2, no: 'AP28X1222'}, | |
{id: 3, no: 'AP28X1333'}, | |
{id: 4, no: 'AP28X1234'}, | |
{id: 5, no: 'AP28X1222'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
function formatName(user) { | |
return user.first + " " + user.last; | |
} | |
const user = { | |
first: "ram", | |
last: "charan" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
//JSX | |
const name = "ramcharan"; | |
const element = <h1>hello {name}</h1>; | |
ReactDOM.render(element, document.getElementById("root")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ReactDOM from "react-dom"; | |
ReactDOM.render(<h1>hello world</h1>, document.getElementById("root")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
class App extends Component { | |
render() { | |
const numbers = [1, 2, 3, 4, 5]; | |
return ( | |
<ul> | |
{numbers.map(number => ( | |
<li key={number.toString()}>{number}</li> | |
))} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
export class App extends Component { | |
render() { | |
const posts = [ | |
{ id: 1, title: "hello world", content: "welcome to the react world" }, | |
{ | |
id: 2, | |
title: "installation", | |
content: "you can install react from npm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
export class App extends Component { | |
render() { | |
const numbers = [1, 2, 3, 4, 5]; | |
return ( | |
<div> | |
<NumbersList numbers={numbers} /> | |
</div> | |
); |
NewerOlder