A wired example of Canvas be cut off by very long .clip() path
Discussion can be found at StackOverflow.
| function getFiberInstance(dom: HTMLElement, traverseUp = 0) { | |
| const key = Object.keys(dom).find((key) => { | |
| return ( | |
| key.startsWith("__reactFiber$") || // react 17+ | |
| key.startsWith("__reactInternalInstance$") | |
| ) // react <17 | |
| }) | |
| const domFiber = dom[key] | |
| if (domFiber == null) return null |
| import { useState }from 'react' | |
| function SwitchComponent() { | |
| const Switch = props => { | |
| const { key, children } = props | |
| return children.find(child => { | |
| return child.props.value === key | |
| }) | |
| } |
| <app-ux-text-card | |
| [data]="[ | |
| { | |
| name: data.name, | |
| value: data.value | |
| } | |
| ]" | |
| > | |
| </app-ux-text-card> |
A wired example of Canvas be cut off by very long .clip() path
Discussion can be found at StackOverflow.
| import { Injectable } from '@angular/core'; | |
| import { Actions, createEffect, ofType } from '@ngrx/effects'; | |
| import { EMPTY } from 'rxjs'; | |
| import { map, mergeMap, catchError } from 'rxjs/operators'; | |
| import { MoviesService } from './movies.service'; | |
| @Injectable() | |
| export class MovieEffects { | |
| loadMovies$ = createEffect(() => this.actions$.pipe( |
| import { NgModule } from '@angular/core'; | |
| import { Routes, RouterModule } from '@angular/router'; | |
| import { HelloPageComponent } from './pages/hello/hello.component'; | |
| const routes: Routes = [ | |
| { | |
| path: 'hello', | |
| pathMatch: 'full', | |
| component: HelloPageComponent |
| import {Component, Input} from '@angular/core' | |
| import { | |
| FormControl, | |
| FormGroup, | |
| ControlValueAccessor, | |
| NG_VALUE_ACCESSOR, | |
| FormBuilder, | |
| Validator | |
| } from '@angular/forms'; |
| /** @jsx createElement */ | |
| import { createElement, useEffect, useState } from 'rax'; | |
| import View from 'rax-view'; | |
| export default function App() { | |
| const [stateParent, setStateParent] = useState(true); | |
| const [stateChild, setStateChild] = useState(true); | |
| useEffect(() => { | |
| setStateChild(!stateChild); |
| function compose(...funcs) { | |
| if (funcs.length === 0) { | |
| return arg => arg | |
| } | |
| if (funcs.length === 1) { | |
| return funcs[0] | |
| } | |
| return funcs.reduce((a, b) => (...args) => a(b(...args))); |
| const BASE_DATASETS = { | |
| airports: { | |
| PKU: { lat: 1, lng: 1, key: 'OKU', count: 1 }, | |
| // ... | |
| } | |
| } | |
| export default BASE_DATASETS; |