reason-react
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -332,7 +332,7 @@ __This documentation assumes relative familiarity with ReactJS.__ | ||
type instanceVars = { | ||
mutable divRef: option Dom.element, /* dom refs directly return the element, no need for the `reactRef` type */ | ||
mutable divRef: option Dom.element, /* dom refs directly return the element or null, no need for the `reactRef` type */ | ||
mutable componentRef: option ReactRe.reactRef | ||
}; | ||
let getInstanceVars () => {divRef: None, componentRef: None}; | ||
let getDivRef componentBag theRef => componentBag.instanceVars.divRef = Some theRef; | ||
let getDivRef componentBag theRef => componentBag.instanceVars.divRef = Js.Null.to_opt theRef; | ||
let getComponentRef componentBag theRef => componentBag.instanceVars.componentRef = Some theRef; | ||
@@ -345,2 +345,4 @@ let render {props, handler} => | ||
**Note** how [React DOM refs can be null](https://github.com/facebook/react/issues/9328#issuecomment-298438237). Which is why `getDivRef` converts `theRef` from a [JS nullable](http://bloomberg.github.io/bucklescript/Manual.html#_null_and_undefined) to an OCaml `option` (Some/None). | ||
Reason-React ref only accept callbacks. The string `ref` from ReactJS is a deprecated feature, which couldn't be easily removed due to the lack of types in JS. | ||
@@ -347,0 +349,0 @@ |
@@ -0,3 +1,6 @@ | ||
## 0.1.3 | ||
DOM ref is now typed as `Js.null Dom.element`, instead of just `Dom.element` (https://github.com/reasonml/reason-react/commit/6f2a75b). Trivial migration: https://github.com/chenglou/reason-react-example/commit/b44587a | ||
## 0.1.2 | ||
Add `defaultValue` prop for input DOM component (c293c6e) | ||
Add `defaultValue` prop for input DOM component (https://github.com/reasonml/reason-react/commit/c293c6e) | ||
@@ -4,0 +7,0 @@ ## 0.1.1 |
@@ -1,7 +0,7 @@ | ||
// Generated by BUCKLESCRIPT VERSION 1.6.0, PLEASE EDIT WITH CARE | ||
// Generated by BUCKLESCRIPT VERSION 1.7.1, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
var ReactDom = require("react-dom"); | ||
var Caml_array = require("bs-platform/lib/js/caml_array"); | ||
var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions"); | ||
var Caml_array = require("bs-platform/lib/js/caml_array.js"); | ||
var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); | ||
@@ -8,0 +8,0 @@ function renderToElementWithClassName(reactElement, className) { |
@@ -1,2 +0,2 @@ | ||
// Generated by BUCKLESCRIPT VERSION 1.6.0, PLEASE EDIT WITH CARE | ||
// Generated by BUCKLESCRIPT VERSION 1.7.1, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by BUCKLESCRIPT VERSION 1.6.0, PLEASE EDIT WITH CARE | ||
// Generated by BUCKLESCRIPT VERSION 1.7.1, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,12 +0,12 @@ | ||
// Generated by BUCKLESCRIPT VERSION 1.6.0, PLEASE EDIT WITH CARE | ||
// Generated by BUCKLESCRIPT VERSION 1.7.1, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
var List = require("bs-platform/lib/js/list"); | ||
var $$Array = require("bs-platform/lib/js/array"); | ||
var Curry = require("bs-platform/lib/js/curry"); | ||
var List = require("bs-platform/lib/js/list.js"); | ||
var $$Array = require("bs-platform/lib/js/array.js"); | ||
var Curry = require("bs-platform/lib/js/curry.js"); | ||
var React = require("react"); | ||
var Caml_array = require("bs-platform/lib/js/caml_array"); | ||
var Pervasives = require("bs-platform/lib/js/pervasives"); | ||
var Js_primitive = require("bs-platform/lib/js/js_primitive"); | ||
var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions"); | ||
var Caml_array = require("bs-platform/lib/js/caml_array.js"); | ||
var Pervasives = require("bs-platform/lib/js/pervasives.js"); | ||
var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); | ||
var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); | ||
@@ -13,0 +13,0 @@ var listToElement = $$Array.of_list; |
{ | ||
"name": "reason-react", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -9,3 +9,2 @@ "main": "index.js", | ||
"start": "bsb -make-world -w", | ||
"build": "webpack -w", | ||
"clean": "bsb -clean-world && rm -f finalOutput/*.js" | ||
@@ -12,0 +11,0 @@ }, |
@@ -18,3 +18,3 @@ # Reason-React | ||
## Development | ||
## Contribute | ||
@@ -26,4 +26,4 @@ ```sh | ||
npm start | ||
# in another window | ||
npm run build | ||
``` | ||
Then add some files somewhere (don't forget to change `bsconfig.json`, if needed). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134465