Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@exweiv/wix-ce-helpers

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exweiv/wix-ce-helpers

Custom element helpers for Wix powered websites/web apps

Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
23
76.92%
Maintainers
1
Weekly downloads
 
Created
Source

Wix Custom Element Helpers

This package contain/s basic helpers to use in frontend for custom elements in Wix.

Example usage of sendJSON:

// Import sendJSON for sending object data as JSON to custom element
import { sendJSON } from "@exweiv/wix-ce-helpers";

$w.onReady(() => {
  sendJSON("props", { clickCount: 100 }, "#customElement");

  $w("#customElement").on("onButtonClick", ({ detail }) => {
    sendJSON("props", { clickCount: detail.count * 2 }, "#customElement");
  });
});

Example usage of ReactElement class:

import React from 'react';
import ReactDOM from 'react-dom';
import { ReactElement } from "@exweiv/wix-ce-helpers";

const fonts = [...strings];
const styles = [...strings];

class ExampleCustomComponent extends ReactElement {
  constructor() {
    super(styles, fonts);
    // your code...

    ...

    // Use pre-created root div for mounting React
    ReactDOM.render(app, this.rootDiv);
  }
}

This will help you to build React based custom elements faster. You can pass null if you don't want to set one of the options.

Keywords

velo

FAQs

Package last updated on 17 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts