Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks stable #10

Merged
merged 8 commits into from Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
@@ -1,7 +1,5 @@
# React Governor

_That typical "HOOKS ARE STILL ALPHA" warning_

Use a governor hook to manage state with actions for, and created by, the people.

## What is `useGovernor`?
Expand All @@ -15,7 +13,7 @@ build the boilerplate of `actions`, `dispatch`, and `reducer`.
```JavaScript
const initialState = { count: 1 };

const count_actions = {
const countActions = {
increment(state) {
return {
count: state.count + 1
Expand All @@ -29,7 +27,7 @@ const count_actions = {
}

export default function Counter() {
const [state, actions] = useGovernor(initialState, count_actions);
const [state, actions] = useGovernor(initialState, countActions);

return (
<div>
Expand Down
26 changes: 14 additions & 12 deletions package.json
Expand Up @@ -29,8 +29,8 @@
"Nate Brady <nbrady@techempower.com>"
],
"peerDependencies": {
"react": "16.8.0-alpha.1",
"react-dom": "16.8.0-alpha.1"
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -56,9 +56,9 @@
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"pretty-bytes": "^5.1.0",
"react": "16.8.0-alpha.1",
"react-dom": "16.8.0-alpha.1",
"react-test-renderer": "16.8.0-alpha.1",
"react": "16.8.1",
"react-dom": "16.8.1",
"react-test-renderer": "16.8.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why would we use ^16.8.0 in peer dependencies but lock it to 16.8.1 for dev deps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer dependencies is the minimum required version of React for this library to work. However, this can still be ^16.8.1 for dev dependencies. Didn't mean to lock it down but wanted to bump to latest for warnings while doing library dev.

"rollup": "^1.1.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.0",
Expand Down Expand Up @@ -111,12 +111,14 @@
]
},
"babel": {
"presets": [[
"react-app",
{
"helpers": false,
"absoluteRuntime": false
}
]]
"presets": [
[
"react-app",
{
"helpers": false,
"absoluteRuntime": false
}
]
]
}
}