How to use use-sidecar - 10 common examples

To help you get started, we’ve selected a few use-sidecar 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 theKashey / react-remove-scroll / __tests__ / UI.tsx View on Github external
import * as React from 'react';
import {configure, mount} from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import {RemoveScroll} from '../src/UI';
import {sidecar} from "use-sidecar";

configure({adapter: new Adapter()});

const tick = () => new Promise(resolve => setTimeout(resolve, 10));

const car = sidecar(() => import ('../src/sidecar'));

describe('UI', () => {
  it('smoke', async () => {
    const wrapper = mount(
      content
    );
    await tick();
    expect(wrapper.html()).toContain('content');
  });

  it('forward', async () => {
    const wrapper = mount(
      
        <div>content</div>
      
    );
github theKashey / react-focus-lock / src / medium.js View on Github external
import { createMedium, createSidecarMedium } from 'use-sidecar';

export const mediumFocus = createMedium(
  {},
  ({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();

export const mediumEffect = createMedium();

export const mediumSidecar = createSidecarMedium({
  async: true,
});
github theKashey / react-focus-lock / src / medium.js View on Github external
import { createMedium, createSidecarMedium } from 'use-sidecar';

export const mediumFocus = createMedium(
  {},
  ({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();

export const mediumEffect = createMedium();

export const mediumSidecar = createSidecarMedium({
  async: true,
});
github theKashey / react-focus-lock / src / medium.js View on Github external
import { createMedium, createSidecarMedium } from 'use-sidecar';

export const mediumFocus = createMedium(
  {},
  ({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();

export const mediumEffect = createMedium();

export const mediumSidecar = createSidecarMedium({
  async: true,
});
github theKashey / react-remove-scroll / src / medium.ts View on Github external
import { createSidecarMedium } from 'use-sidecar';

export const effectCar = createSidecarMedium();
github theKashey / react-focus-on / src / medium.ts View on Github external
import { createSidecarMedium } from 'use-sidecar';

export const effectCar = createSidecarMedium();
export const focusHiddenMarker = 'data-focus-on-hidden';
github theKashey / react-focus-lock / src / medium.js View on Github external
import { createMedium, createSidecarMedium } from 'use-sidecar';

export const mediumFocus = createMedium(
  {},
  ({ target, currentTarget }) => ({ target, currentTarget }),
);
export const mediumBlur = createMedium();

export const mediumEffect = createMedium();

export const mediumSidecar = createSidecarMedium({
  async: true,
});
github theKashey / react-remove-scroll / src / sidecar.tsx View on Github external
import { exportSidecar } from 'use-sidecar';
import { RemoveScrollSideCar } from './SideEffect';
import { effectCar } from './medium';

export default exportSidecar(effectCar, RemoveScrollSideCar);
github theKashey / react-focus-lock / src / sidecar.js View on Github external
import { exportSidecar } from 'use-sidecar';
import FocusTrap from './Trap';
import { mediumSidecar } from './medium';

export default exportSidecar(mediumSidecar, FocusTrap);
github theKashey / react-focus-on / src / sidecar.ts View on Github external
import { exportSidecar } from 'use-sidecar';

import 'react-focus-lock/sidecar';
import 'react-remove-scroll/sidecar';

import { Effect } from './Effect';
import { effectCar } from './medium';

export default exportSidecar(effectCar, Effect);

use-sidecar

Sidecar code splitting utils

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis