Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Fix screen template: useStores() comments (#336)
Browse files Browse the repository at this point in the history
uncommenting the line `const { someStore } = useStores()` in a newly created project gives an unintuitive **TypeError**.  
I understand that the use of rootStore may be discouraged, but it may be useful for beginners at least to add a line that works as is when uncommented.
  • Loading branch information
guglie authored May 7, 2020
1 parent efbf9a9 commit 928381c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/screen.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const ROOT: ViewStyle = {
}

export const <%= props.pascalName %>: React.FunctionComponent<<%= props.pascalName %>Props> = observer((props) => {
// const { someStore } = useStores()
// const { someStore, anotherStore } = useStores()
// OR
// const rootStore = useStores()
return (
<Screen style={ROOT} preset="scroll">
<Text preset="header" tx="<%= props.camelName %>.header" />
Expand Down

0 comments on commit 928381c

Please sign in to comment.