themesberg / themesberg/flowbite

When using a wrapper component then Flowbite pages/components are not working

Open
#534 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
9.4k
Forks
862
PR merge metrics
No merged PRs in 30d

Description

I created a website page template that sets my sites basic look and feel, but when I pass the main section as a CHILDREN prop then the Flowbite events do not fire. I did lot of experimentation and the culprite is the wrapper. Here is a basic example of how it is setup.

import { Component } from "solid-js";

// Define the layout component
const Layout: Component = (props) => {
  return (
    <div>
      <header>
        {/* Add header content here */}
      </header>
      <main>
        {/* Render the page component here */}
        {props.children}
      </main>
      <footer>
        {/* Add footer content here */}
      </footer>
    </div>
  );
};

// Define a page component
const HomePage: Component = () => {
  return <h1>Welcome to my website!</h1>;
};

// Use the layout component to wrap the page component
const App: Component = () => {
  return (
    <Layout>
      <HomePage />
    </Layout>
  );
};

If you set a simple button and tooltip within the Home Page it will not activate. But if you duplicate the exact same code into the App component directory or just comment out the "Layout" tags then it works just fine.

Is there something I'm just not configuring correctly? I even attempted to import flowbite into every component but it makes no difference. I tried setting this up in Stackblitz but it doesn't compile.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the minimal Layout, HomePage, and App example in the issue and try reproducing it in StackBlitz, noting that the reporter says StackBlitz does not compile. Compare the wrapped and unwrapped button and tooltip cases; done means identifying whether the wrapper is causal and documenting the required configuration or a confirmed incompatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tailwindcss
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.