How to use react-plugin - 8 common examples

To help you get started, we’ve selected a few react-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-cosmos / react-cosmos / packages / react-cosmos-playground2 / src / plugins / ResponsivePreview / __tests__ / noFixtureSelected.tsx View on Github external
function loadTestPlugins() {
  loadPlugins();
  return render(
    <>
      
      
        <div data-testid="previewMock">
      
    
  );
}
</div>
github react-cosmos / react-cosmos / packages / react-cosmos-playground2 / src / testHelpers / plugin.ts View on Github external
export function mockPlug(
  slotName: string,
  component: PlugComponentType
) {
  const name = getNewPluginName();
  const testPlugin = createPlugin({ name });
  testPlugin.plug(slotName, component);
  testPlugin.register();
}
github react-cosmos / react-cosmos / packages / react-cosmos-playground2 / src / testHelpers / plugin.ts View on Github external
export function getMethodsOf(
  pluginName: Spec['name']
) {
  const name = getNewPluginName();
  createPlugin({ name }).register();

  return getPluginContext(name).getMethodsOf(pluginName);
}
github react-cosmos / react-cosmos / packages / react-cosmos-playground2 / src / testHelpers / plugin.ts View on Github external
export function on(
  pluginName: Spec['name'],
  handlers: EventHandlers
) {
  const name = getNewPluginName();
  const testPlugin = createPlugin({ name });
  testPlugin.on(pluginName, handlers);
  testPlugin.register();
}

react-plugin

API for composable 3rd party React plugins

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Similar packages