Function that returns
- Component display name if defined
- Function name
- Predefined value, "Component" by default
| /* | |
| echo "48656c6c6f20576f726c64210a" | node encode.js -f hex | |
| echo "€~𝘈Ḇ𝖢𝕯٤ḞԍНǏ𝙅ƘԸ<2c98>𝙉০Ρ𝗤Ɍ𝓢ȚЦ𝒱Ѡ𝓧ƳȤѧᖯć𝗱ễ𝑓𝙜Ⴙ𝞲𝑗𝒌ļṃʼnо𝞎𝒒<1d72><a731>𝙩ừ𝗏ŵ𝒙𝒚ź1234567890" | node encode.js -t hex | node encode.js -f hex | |
| */ | |
| const { Transform } = require('stream'); | |
| const { readArgs } = require('./util'); | |
| class ConvertEncoding extends Transform { | |
| constructor(from = 'utf8', to = 'utf8') { | |
| super(); |
| source.js |
| /** | |
| * Metro configuration for React Native | |
| * https://github.com/facebook/react-native | |
| * | |
| * @format | |
| */ | |
| const path = require('path'); | |
| module.exports = { |
| source.js |
| ` Checkbox, | |
| Chip, | |
| DataTable, | |
| Button, | |
| Paragraph, | |
| Dialog, | |
| Portal, | |
| Divider, | |
| Text, | |
| Drawer, |
| document | |
| .querySelectorAll('.product-row__price.product-row__alignment') | |
| .forEach((row) => { | |
| const node = row.querySelector('.product-row-price--old ._price'); | |
| const oldPrice = parseFloat(node.innerText); | |
| const newPrice = parseFloat( | |
| row.querySelector('.product-row-price--new ._price').innerText, | |
| ); | |
| node.innerText = ` ${((1 - newPrice / oldPrice) * 100) >> 0}%`; | |
| node.parentElement.style.textDecoration = 'none'; |
| import React, { createContext } from 'react'; | |
| import { ErrorHandler } from './withDidCatch'; | |
| const { Provider, Consumer } = createContext(); | |
| Provider.displayName = 'ErrorBoundaryContextProvider'; | |
| Consumer.displayName = 'ErrorBoundaryContextConsumer'; | |
| export const ErrorBoundaryProvider = ({ onRenderError }) => ( | |
| <Provider value={onRenderError}>{children}</Provider> |
Simple functional component that uses regular expression to add zero-width spaces to a string passed into value property and/or children. Zero-width spaces are used to add line breaks which appear when text does not fit into container. It can be used with value property
import SpaceWrap from '@actualwave/react-space-wrap';
export const MyText = () => (| source.js |