Comments (5)
I suggest dropping inputType in favour of withType, and have withType surface all allowed members for any type: withType.submit, withType.date, withType.toolbar.
You could also have a string-accepting member on the prop type: prop.withType "foo" in addition to the enum props. They combine nicely.
@cmeeren I like this idea because it is not good if we keep both inputTypes
and withType
in the DSL, I will try to implement it soon
from feliz.
You are right!
I am a bit conflicted on this, I like that inputTypes
reflects the possible types for an input but I am not sure I want buttonTypes
and menuTypes
in the DSL along with a free-text value. I will take a look at what other DSL's do
from feliz.
Do you have any suggestions on what should be the the property? I have a couple myself but I don't care which one gets in because I think I need to make a choice and if it is really bad (I doubt it) then it can be re-worked later
I am thinking
prop.withType : string -> IReactAttribute
because thewith*
prefix is common for F# devsprop.useType : string -> IReactAttribute
kind of OKprop.setType : string -> IReactAttribute
also kind of OK but I don't like it because it resembles OOP codeprop.ofType : string -> IReactAttribute
meh because there is a react helper in Fable.React for importing 3rd party components called the same
Even with these, withType
and setType
are my highest candidates because they are closest to what "setting an attribute called type
represent". I also use string
as input because other that inputTypes
, these attributes won't be used a lot (I think)
@cmeeren @MangelMaxime what do you think?
from feliz.
Of those, I like withType
best. I can't think of better alternatives at the moment. (Well, type'
, but... 😅)
I also use
string
as input
I suggest dropping inputType
in favour of withType
, and have withType
surface all allowed members for any type: withType.submit
, withType.date
, withType.toolbar
.
You could also have a string
-accepting member on the prop
type: prop.withType "foo"
in addition to the enum props. They combine nicely.
from feliz.
withType
seems good to be
from feliz.
Related Issues (20)
- Q: Documentation on breaking changes in 2.6? [WAS Updating Feliz.UseListener to Feliz 2.6.0] HOT 4
- CSS overflow-anchor property HOT 1
- Error with Feliz 2.7 HOT 2
- Making UseElmish's dispatch function stable
- Feliz.Markdown escapeHtml doesn't seem to work HOT 1
- UseElmish: Failed to resolve import "use-sync-external-store/shim" HOT 3
- `react-markdown` removes the `escapeHtml` property HOT 1
- Clarification and Potential Improvement on PR #480 useEffectOnce behavior HOT 5
- Expanding Feliz.Rechart HOT 3
- Component created with a forwardRef that has generic type parameters loses state HOT 2
- "Directory import use-sync-external-store\shim is not supported" in UseElmish.fs.js HOT 2
- Use with Elmish documentation is lacking integration HOT 2
- Enhance Handling of F# Record Types as Props in ReactComponent Attribute HOT 4
- Explore if Feliz.CompilerPlugin can support POJO made using `[<ParamObject>]`
- prop.pattern produces invalid html HOT 4
- React 19 HOT 4
- Svg attribute `fill-rule` missing
- Update tests and move to github actions [Contributions Welcome]
- Doc changes havent been pushed to site HOT 1
- Feliz.popover auto positioning does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feliz.