Skip to content

[Bug] reduce friction when consuming react-components as a dependency #1810

@boweihan

Description

@boweihan

Describe the bug
Consuming @iot-app-kit/react-components per instructions currently requires pulling in several other dependencies including sass, is-hotkey, react-hotkeys, and react-popper.

To Reproduce
Steps to reproduce the behavior:
Set up any react application with the following client component code:

import { initialize } from "@iot-app-kit/source-iotsitewise";
import { LineChart, WebglContext } from "@iot-app-kit/react-components";

import "@iot-app-kit/components/styles.css";

const { query } = initialize({
  awsCredentials: {
    accessKeyId: YOUR_ACCESS_KEY_ID,
    secretAccessKey: YOUR_SECRET_ACCESS_KEY,
    sessionToken: YOUR_TOKEN 
  },
  awsRegion: "us-west-2",
});

export default function Client() {
  return (
    <>
      <LineChart
        queries={[
          query.timeSeriesData({
            assets: [
              {
                // Replace sitewse-asset-id with the ID of your AWS IoT SiteWise asset.
                assetId: "sitewise-asset-id",
                // Replace property-id with the ID of your AWS IoT SiteWise asset property.
                properties: [
                  { propertyId: "property-id" },
                ],
              },
            ],
          }),
        ]}
      />
      <WebglContext />
    </>
  );
}

Expected behavior
This works with only prescribed dependencies - react-components and source-iotsitewise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions