Skip to content

Connect MobX (and mobx-state-tree) to React with plain old JS props!

Notifications You must be signed in to change notification settings

unirakun/k-mobx-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k-mobx-react

🚧 this is a work in progress 🚧

Connect MobX (and mobx-state-tree) to React with plain old JS props!

This is a better isolation of concerns

CircleCI Coverage Status NPM Version Size

Contents

Purpose

This library offer the same inject API that the standard mobx-react library. What differs is about the types of props that are injected in the wrapped ReactJS component.

  • With the standard mobx-react the props injected can be observable.
  • With k-mobx-react the props injected are plain old JS objects.

Why

We feel that observable object in ReactJS component enforce bad pattern of developments:

  • It pushed the use of nested props into a ReactJS component
    • We think that flat props are best because it is easier to optimise this kind of components
  • You have to use customs PropTypes
  • You can't bind a common React Component with this kind of objects
    • We have some problems our existing React components that did not always worked as expected

Installation

  • npm install --save k-mobx-react
  • yarn add k-mobx-react

API

  • You can just change you mobx-react import with the new one: k-mobx-react
  • If you use nested props, you should changes them to use flat props

Examples

TODO

About uni rakun

uni rakun is created by two passionate french developers.

Do you want to contact them ? Go to their website

Guillaume CRESPEL Fabien JUIF

Releases

No releases published

Packages

No packages published