GithubHelp home page GithubHelp logo

react-simply's People

Contributors

lukashala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-simply's Issues

Rename getState -> useState

getState() is meant to be used as React hook, so we may use more compatible name useState(). This would for example enable proper detection as hook by eslint-plugin-react-hooks.

Thought on the Reducer

Wondering what you think about doing this for your reducer instead of the switch statement? My thoughts were switch statements could get long, plus maintaining a large one could be annoying. Plus the type key/value pair seems redundant if you make the added state object agnostic of static state names.

const reducer = (state, action) => {
  const actionKey = Object.getOwnPropertyNames(action)
  return action ? { ...state, [actionKey] : action[actionKey] } : state
}

instead of dispatching like so,

() => dispatch({ type: 'type', thing: false})

you would dispatch like so,

() => dispatch({thing: false})

Error Unexpected token

As you can see in the image, there is an error inside the index.js file of the lib

image

Versions:

Stack Version
@react-simply/state 1.0.2
react 16.8.6
node 11.13.0
npm 6.7.0
yarn 1.15.2

Middleware Support

Hi... First of all, thx for sharing this solution. I've found a way to support middleware/enhancers for This solution, there's still some testing and validation. Do You think It could be a nice addition?

Invalid Hook call

I'm receiving this error regarding line 35 of your script.

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
    See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.