coder_iyke
coder_iyke
PD🧩 Plasmo Developers
Created by Tikaï on 10/24/2024 in #🔰newbie
Pass custom props to CSUI component
Let me explore that. I have been on this issue since yesterday without progress.
8 replies
PD🧩 Plasmo Developers
Created by Tikaï on 10/24/2024 in #🔰newbie
Pass custom props to CSUI component
I am currently having an issue where the CSUI elements are re-rendered infinitely, and using up system resources but it isn't caused by the render function
8 replies
PD🧩 Plasmo Developers
Created by Tikaï on 10/24/2024 in #🔰newbie
Pass custom props to CSUI component
I had this exact same problem (getInlineAnchorList too!) yesterday and was able to get it to work. You have to export a render function. Here's an example that worked for me:
export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({
createRootContainer
}) => {
console.log('%c calling render', 'color: red; font-weight: bold;');
const elements = document.querySelectorAll(`[data-testid="regular-listings"] > div a:first-of-type > div > div:nth-of-type(3) > h2`);
Array.from(elements).map(async (element, index) => {
const rootContainer = await createRootContainer({
element,
type: "inline",
insertPosition: 'afterend',
} as any)
const root = createRoot(rootContainer)
root.render(<SearchResults id={index.toString()} key={index.toString()} index={index} />)
});
}
export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({
createRootContainer
}) => {
console.log('%c calling render', 'color: red; font-weight: bold;');
const elements = document.querySelectorAll(`[data-testid="regular-listings"] > div a:first-of-type > div > div:nth-of-type(3) > h2`);
Array.from(elements).map(async (element, index) => {
const rootContainer = await createRootContainer({
element,
type: "inline",
insertPosition: 'afterend',
} as any)
const root = createRoot(rootContainer)
root.render(<SearchResults id={index.toString()} key={index.toString()} index={index} />)
});
}
8 replies
PD🧩 Plasmo Developers
Created by Melinda on 8/12/2024 in #👾extension
Chrome storage API vs Dexie.js (IndexedDB)
I have used Dexie with Plasmo and it was near straightforward to implement, and has a clean interface. If you are not handling large datasets client-side, I don't see the need for it.
6 replies
PD🧩 Plasmo Developers
Created by nithur on 10/20/2024 in #👾extension
Anyone got react-markdown work with Plasmo?
I had this same challenge, couldn't get it to work with Plasmo, and eventually switched it out for markdown-to-jsx
3 replies