DWTFYW
Disclaimer:
- no warranty this will work for you!
- I'm not responsible of how you use this!
- READ, VERIFY and TEST the CODE before using!
| //@flow | |
| /* eslint-disable */ | |
| class ArrayBufferView {} | |
| class WebGLObject { | |
| _id: number; | |
| constructor (id: number) { | |
| this._id = id; | |
| } | |
| } | |
| class WebGLBuffer extends WebGLObject {} |
| activeTexture | |
| attachShader | |
| bindAttribLocation | |
| bindBuffer | |
| bindFramebuffer | |
| bindRenderbuffer | |
| bindTexture | |
| blendFunc | |
| bufferData | |
| checkFramebufferStatus |
| document.write(`<link rel="stylesheet" href="https://rawgit.com/PrismJS/prism/gh-pages/themes/prism.css" />`); | |
| var Prism = require('prismjs'); | |
| var code = [ | |
| "const c = `", | |
| "// do something", | |
| "float a = p.x * p.y;", | |
| "", | |
| "// do something else", |
| //@flow | |
| import React, { Component } from "react"; | |
| import { Bus } from "gl-react"; | |
| import { Surface } from "gl-react-dom"; | |
| import colorScales from "./colorScales"; | |
| const shaders = Shaders.create({ | |
| colorify: { | |
| frag: GLSL` | |
| precision highp float; |
| import React, { | |
| Component, | |
| } from "react"; | |
| import { | |
| Image as RNImage, | |
| View, | |
| } from "react-native"; | |
| const debugImage = | |
| __DEV__ |
| const { transform, execute } = require("./lib"); | |
| const ReactNativeWeb = require("react-native-web"); | |
| const {render} = require("react-dom"); | |
| const example = ` | |
| ...jestsnapshotcodegoeshere | |
| `; | |
| const out = transform(example); | |
| const node = execute(out, { |
DWTFYW
Disclaimer:
| // more minimal version of https://github.com/olahol/scrollparent.js/blob/master/scrollparent.js | |
| const regex = /(auto|scroll)/; | |
| const style = (node, prop) => | |
| getComputedStyle(node, null).getPropertyValue(prop); | |
| const scroll = (node) => | |
| regex.test( | |
| style(node, "overflow") + | |
| style(node, "overflow-y") + |
This is a PoC that will be later a PR to react-native-view-snapshot to implement the feature for Android.
We still need to wait React Native to have the addUIBlock feature provided by this PR.
Also, I'll wait react-native-view-snapshot to implement the same API as the current RN takeSnapshot on iOS allowing the options.
import {NativeModules, findNodeHandle} from "react-native";| class Foo extends Component { | |
| constructor () { | |
| super(); | |
| this.state = { | |
| data: null, | |
| error: null, | |
| pending: false | |
| }; | |
| } |