Replies: 2 comments
-
Personnally I prefer Adonis having the lead on what are the props and their type. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Turns out what I wanted is possible. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now the idea is that the controller defines the output and the component conforms to the prop requirements.
It should be inverted.
Instead of
It should be the controller importing the component type, and reading its normal props but when the render call is executed each prop key value type is a union if
X | () => X | Lazy<X>
- Not sure what type Lazy is now but can get there later.Name of the component, lookup path in the filesystem and the types should all be inferred by the render call.
This removes stringly bits, and it's usually the components that have a requirement of data for presentation purposes, not the controller.
Now I understand there are some issues here. You need the component name for matching the headers and other stuff, but also for doing the pages lookup on the glob.
There has to be a way to manage that without passing in a string and making the component conform to the requirements.
Beta Was this translation helpful? Give feedback.
All reactions