@wixc3/react-simulation

Library for creation of React component simulations

Usage no npm install needed!

<script type="module">
  import wixc3ReactSimulation from 'https://cdn.skypack.dev/@wixc3/react-simulation';
</script>

README

@wixc3/react-simulation

npm version

Library for creation of React component simulations.

Usage

Given:

// hello.tsx

import React from 'react';

export interface HelloProps {
  name: string;
}
export const Hello: React.VFC<HelloProps> = ({ name }) => <div>Hello ${name}</div>;

This library can be used to create simulations for Hello:

// hello.sim.tsx

import { createSimulation } from '@wixc3/react-simulation';
import { Hello } from './hello';

createSimulation({
  name: 'basic simulation',
  componentType: Hello,
  props: { name: 'World' },
});

License

MIT