Skip to main content
Module

x/valtio/tests/__snapshots__/macro.test.ts.snap

πŸ’Š Valtio makes proxy-state simple for React and Vanilla
Go to Latest
File
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`valtio/macro 1. valtio/macro: 1. valtio/macro 1`] = `
import { useProxy } from '../dist/macro'
const Component = () => { useProxy(state) return ( <div> {state.count} <button onClick={() => ++state.count}>inc</button> </div> )}
↓ ↓ ↓ ↓ ↓ ↓import { useSnapshot as _useSnapshot } from 'valtio'const Component = () => { const valtio_macro_snap_state = _useSnapshot(state) return ( <div> {valtio_macro_snap_state.count} <button onClick={() => ++state.count}>inc</button> </div> )}

`;
exports[`valtio/macro 2. valtio/macro: 2. valtio/macro 1`] = `
import { useProxy } from '../dist/macro'
const Component = () => { useProxy(state) return ( <div> <button onClick={() => { ;(() => ++state.count)() ++state.count }}>inc</button> {state.count} </div> )}
↓ ↓ ↓ ↓ ↓ ↓import { useSnapshot as _useSnapshot } from 'valtio'const Component = () => { const valtio_macro_snap_state = _useSnapshot(state) return ( <div> <button onClick={() => { ;(() => ++state.count)() ++state.count }}> inc </button> {valtio_macro_snap_state.count} </div> )}

`;