seas-computing / mark-one

A UI component library for building React Apps (in development)
https://seas-computing.github.io/mark-one/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Fix Form and Button components #173

Closed natalynyu closed 6 months ago

natalynyu commented 6 months ago

This PR updates the Form component to fix the following error that we are receiving when trying to use it:

Type '{ children: Element[]; id: string; label: string; submitHandler: () => void; }' is not assignable to type 'IntrinsicAttributes & FormProps'.
  Property 'children' does not exist on type 'IntrinsicAttributes & FormProps'. 

We have seen this error in the past when trying to update Mark One to React 18. This was solved by explicitly passing down children as a prop.

The PR also updates the Button component to include an optional type property. If not specified, the type defaults to button. This way, we will be able to specify a type of submit so that we can more properly handle and associate forms with submit buttons.

Describe your changes

Types of changes

Checklist:

Priority:

Related Issues:

Fixes #40

natalynyu commented 6 months ago

@rmainseas Thanks Robert, that makes sense! (For some reason I'm not able to reply under your comment). I reverted the test in d68228c.