Skip to content

How can I reference a parent element of #plasmo-shadow-container when a button inside the CSUI component is clicked? #466

Answered by uri3000
uri3000 asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out, incase anyone needs something like this:


import React, { useEffect, useState, useRef } from 'react';
import type { PlasmoCSConfig, PlasmoGetInlineAnchor, PlasmoGetStyle } from "plasmo";
import type { generateKey } from "crypto";
import { renderToString } from 'react-dom/server';
import createCache from "@emotion/cache";
import { CacheProvider } from "@emotion/react";
import { ToolbarButton, GoogleSuggestionButton, ComposeToolbar } from './content.styled';

export const config: PlasmoCSConfig = {
  matches: ["https://mail.google.com/*"],
  run_at: "document_end"
  }

  const styleElement = document.createElement("style");

  const styleCache = createCache({
    key: "plasm…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by uri3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant