This file contains hidden or 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
| // version 1 | |
| import React, { useRef, FC } from 'react'; | |
| import { View, StyleSheet, ScrollView } from 'react-native'; | |
| import { normalize } from 'src/utils/tools'; | |
| interface Props { | |
| childrens: JSX.Element[]; | |
| } | |
| const PaginatedHorizontalList: FC<Props> = ({ childrens }) => { |
This file contains hidden or 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
| //App.tsx in RN | |
| ///other imports | |
| import messaging from '@react-native-firebase/messaging'; | |
| import notifee from '@notifee/react-native'; | |
| const App: FC<Props> = ({ storeToken }) => { | |
| const requestFCMPermission = () => { | |
| const authResponse = await messaging().requestPermission(); | |
| const enabled = authResponse === messaging.AuthorizationStatus.AUTHORIZED || authStatus === messaging.AuthorizationStatus.PROVISIONAL; |
This file contains hidden or 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 express from "express"; | |
| import rateLimit from "express-rate-limit"; | |
| import api from './src/api'; | |
| const app = express(); | |
| app.use(cors()); | |
| const apiLimiter = rateLimit({ | |
| windowMs: 1 * 60 * 1000, // 1 minutes | |
| max: 100, |
This file contains hidden or 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, { useState } from 'react' | |
| import Header from './Header' | |
| import Body from './Body' | |
| import Button from './Button' | |
| export default () => { | |
| return ( | |
| <> | |
| <Header /> | |
| <Body /> |
This file contains hidden or 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'; | |
| import './index.css'; | |
| import App from './App.jsx' | |
| import store from './store'; | |
| import { Provider } from 'react-redux'; | |
| ReactDOM.render( | |
| <Provider store={store}> | |
| <App /> |
This file contains hidden or 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 { createContext, useContext, useState } from "react"; | |
| const NumberContext = createContext(); | |
| const StringContext = createContext(); | |
| const Body = () => { | |
| console.log("render Body"); | |
| return <></>; | |
| }; |
This file contains hidden or 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 { createContext, useContext, useState } from "react"; | |
| const NumberContext = createContext(); | |
| /** | |
| * Body component | |
| * not subscribed to the context value | |
| */ | |
| const Body = () => { | |
| console.log("render Body"); |
This file contains hidden or 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 { createContext, useState } from "react"; | |
| const NumberContext = createContext(); | |
| const Body = () => { | |
| console.log("render Body"); | |
| return <></>; | |
| }; | |
| const Header = () => { |