strudel/packages/react
2022-11-10 16:36:51 +01:00
..
dist fix mini repl + improve repl api 2022-11-10 16:36:51 +01:00
examples/nano-repl move evaluate logic without transpiler to core 2022-11-06 12:12:43 +01:00
src fix mini repl + improve repl api 2022-11-10 16:36:51 +01:00
.gitignore react packaging 2022-05-17 21:40:17 +02:00
.npmignore hotfix: npmignore react examples 2022-11-06 19:39:05 +01:00
index.html basic react package build config 2022-05-17 00:32:57 +02:00
package.json started refac repl to new scheduler + transpiler 2022-11-10 12:07:36 +01:00
postcss.config.js basic react package build config 2022-05-17 00:32:57 +02:00
README.md move evaluate logic without transpiler to core 2022-11-06 12:12:43 +01:00
tailwind.config.js basic react package build config 2022-05-17 00:32:57 +02:00
vite.config.js add missing external deps to react pkg 2022-09-14 21:55:09 +02:00

@strudel.cycles/react

This package contains react hooks and components for strudel. It is used internally by the Strudel REPL.

Install

npm i @strudel.cycles/react

Usage

Here is a minimal example of how to set up a MiniRepl:

import { evalScope, controls } from '@strudel.cycles/core';
import { MiniRepl } from '@strudel.cycles/react';
import { prebake } from '../repl/src/prebake.mjs';

evalScope(
  controls,
  import('@strudel.cycles/core'),
  import('@strudel.cycles/tonal'),
  import('@strudel.cycles/mini'),
  import('@strudel.cycles/webaudio'),
  /* probably import other strudel packages */
);

prebake();

export function Repl({ tune }) {
  return <MiniRepl tune={tune} hideOutsideView={true} />;
}

Development

If you change something in here and want to see the changes in the repl, make sure to run npm run build inside this folder!

npm run dev # dev server
npm run build # build package