Questions tagged [preact]

Utilized to address inquiries concerning Preact, a swift 3kb substitute for React.

Is it possible to alter preact-material-components to switch to mdc-theme--dark mode, thereby changing the CSS style of all descendant components?

I recently created a preact-cli app and added the following code in Header.js: document.body.classList.add('mdc-theme--dark'); However, when a user tries to switch from the light theme to the dark theme, only the background of the app changes. I've notic ...

Exploring different preact.js configurations to set up a simple environment for debugging the source code

Exploring the depths of preact.js has proven to be quite a challenge. Despite successfully setting up the framework using webpack build from the preact-boilerplate setup, I am encountering difficulty in accessing and intercepting the code for debugging pur ...

Preact: occasional occurrence of a blank page after refreshing

Starting out with Preact & TypeScript, I decided to kickstart my project using the parcel-preact-typescript-boilerplate. Initially, everything seemed to be working smoothly. However, I noticed that occasionally, especially on reload or initial page lo ...

Encountering a console error in a TypeScript Express app when using MUI and Preact: "Unexpected prop `children` passed to `InnerThemeProvider`, was expecting a ReactNode."

I'm working on integrating MUI with a Preact app. In VSCode, everything seems to be set up correctly, but when I try to view it in the browser, nothing renders and I get this console error: react-jsx-runtime.development.js:87 Warning: Failed prop type: Inv ...

Using Typescript and React to render `<span>Text</span>` will only display the text content and not the actual HTML element

My function is a simple one that splits a string and places it inside a styled span in the middle. Here's how it works: splitAndApplyStyledContent(content: string, textType: string, separator: string) { const splittedContent = content.split(separator); ...

Preact was implemented within the Shadow DOM, but unfortunately, all of the styles were

Currently in the process of constructing a widget, I aim to load the Preact app for the widget within the shadow DOM to prevent any conflicts with CSS. Gratefully, I have achieved this successfully using the following technique: const host = document.que ...

What is the best way to update the value of a preact signal from a different component?

export const clicked = signal(false); const handleClickDay = (date) => { const day = date.getDate().toString().padStart(2,'0') const month = (date.getMonth()+1).toString().padStart(2,'0') const year = da ...

In order to handle this file type, make sure you have the right loader set up for Preact

Help! I'm struggling with a React issue and need some assistance. I've searched through various posts but haven't found a solution yet, so I'm turning to you for help. I am working with simple React on a webpack-dev-server, and when trying to set up preac ...