Giter Club home page Giter Club logo

Comments (2)

fredrikgustn avatar fredrikgustn commented on June 5, 2024

I have a similar issue that seems to be related to the react version. I have the same issue with the provided sample pro templates where it's not possible to build however it works when running in developer mode.

Depending on which react version that I use, I can get different results and different incopability problems. This is what I get when I use the default version from the blog-tailwind-nextjs sample project. I tested it to first rule out problem in my own code.

./src/app/blog-posts.tsx:39:8
Type error: Type '{ children: string; color: "gray"; className: string; size: "sm"; }' is missing the following properties from type 'Pick<ButtonProps, "children" | "color" | "translate" | "slot" | "style" | "title" | "onChange" | "onClick" | "className" | "key" | "defaultChecked" | "defaultValue" | ... 261 more ... | "loading">': placeholder, onPointerEnterCapture, onPointerLeaveCapture

  37 |   return (
  38 |     <section className="w-full max-w-6xl mx-auto flex flex-col items-center px-4 py-20">
> 39 |       <Button color="gray" className="mb-3" size="sm">
     |        ^
  40 |         BLOG
  41 |       </Button>
  42 |       <Typography variant="h3" className="text-center" color="blue-gray">

from material-tailwind.

unloop avatar unloop commented on June 5, 2024

@bryanlundberg You need to add controller on top of component from react-hook-form.

import { FC } from "react";
import { Controller, FormProvider, useForm } from "react-hook-form";
import { Option, Select } from "@material-tailwind/react";

export interface IProps {
}

export const ProfileForm: FC<IProps> = () => {
  const methods = useForm();

  async function onSubmit(data: any) {
    console.log("Submit:", data);
  }

  return (
    <FormProvider {...methods}>
      <form onSubmit={methods.handleSubmit(onSubmit)}>
        <Controller
          name="data"
          control={methods.control}
          render={({ field: { onChange, value } }) => (
            <Select
              name="data"
              label="Select value"
              value={value}
              onChange={onChange}>
              <Option value="demo1">Demo1</Option>
              <Option value="demo2">Demo2</Option>
            </Select>
          )}/>
      </form>
    </FormProvider>
  )
}

from material-tailwind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.