Closed bryanstearns closed 4 years ago
@jamonholmgren NB: This replaces the --functionComponent
and --stateless-function
command line options on ignite generate component
(with --observer
and --no-observer
); not sure whether we count that as a breaking change for versioning...
Waiting for #362 (cc @nirre7) and then we'll release as 6.0.0.
@bryanstearns The whole function thing is "my bad". I though that to be able to use hooks one had to use the React.FunctionComponent .. Yepp, I was wrong. Thank god there are people smarter than me :relieved:
@jamonholmgren I'll try to get the #362 tests sorted today.
:tada: This PR is included in version 5.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Standardized component definitions
After internal deliberation at IR, we've concluded that it's best to use
function
syntax when declaring functional components (including screens; gets us more-useful stacktraces), and not to useReact.FunctionComponent
as the parent type of component prop interfaces (see #358). So, plain components are simply:Components wrapped with
mobx-react-lite
'sobserver
HOC (including nearly all screens) use this slightly-more-verbose version (which, yes, has the function name twice, but we feel this is a small price to pay for nice stacktraces!):So, then, this PR...
I started by cherry-picking the commits from #316 which generates screens in a subdirectory; they needed merge updates against current master (thanks to @lasharela for #316, and to @BrandonSM who contributed very similar work in #331). Then:
--observer
or--no-observer
on theignite generate component
command line.Screen
or-screen
equally; it now always uses kebab-case in the filenames.