
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
react-zdog
Advanced tools
npm install zdog react-zdog
react-zdog is a declarative abstraction of zdog, a cute pseudo 3d-engine. Doing zdog in React allows you to break up your scene graph into declarative, re-usable components with clean, reactive semantics. Try a live demo here.
import ReactDOM from 'react-dom'
import React from 'react'
import { Illustration, Shape } from 'react-zdog'
ReactDOM.render(
<Illustration zoom={8}>
<Shape stroke={20} color="lightblue" />
</Illustration>,
document.getElementById('root')
)
Comming soon ... For now, this little demo here has it all covered. react-zdog basically forwards props to zdog primitives, anything you can do in zdog is possible here, too.
The Illustration
object is your portal into zdog. It forwards unreserved properties to the internal Zdog.Illustration instance.
<Canvas element="svg" /> // Can bei either 'svg' or 'canvas'
All hooks can only be used inside the Illustration element because they rely on context updates!
If you're running effects that need to get updated every frame, useRender gives you access to the render-loop.
import { useRender } from 'react-zdog'
function MyComponent() {
// Subscribes to the render-loop, gets cleaned up automatically when the component unmounts
useRender(t => console.log("I'm in the render-loop"))
Gives you access to the underlying state-model.
import { useZdog } from 'react-zdog'
function MyComponent() {
const {
illu, // The parent Zdog.Illustration object
scene, // The Zdog.Anchor object that's being used as the default scene
size, // Current canvas size
} = useZdog()
FAQs
React-fiber renderer for zdog
The npm package react-zdog receives a total of 152,305 weekly downloads. As such, react-zdog popularity was classified as popular.
We found that react-zdog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.