Skip to content

Update for react-15 #99

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

Merged
merged 6 commits into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.psci*
bower_components/
node_modules/
output/
.psc-package
.psc-ide-port
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "purescript-react",
"files": [],
"peerDependencies": {
"react": "^0.14.3"
"react": "^15.6.1",
"create-react-class": "^15.6.0"
}
}
3 changes: 2 additions & 1 deletion src/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"use strict";

var React = require("react");
var createReactClass = require("create-react-class");

function getProps(this_) {
return function(){
Expand Down Expand Up @@ -117,7 +118,7 @@ function createClass(spec) {
}
};

return React.createClass(result);
return createReactClass(result);
}
exports.createClass = createClass;

Expand Down
27 changes: 27 additions & 0 deletions src/React/DOM/Props.purs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,26 @@ security = unsafeMkProps "security"
unselectable :: Boolean -> Props
unselectable = unsafeMkProps "unselectable"

onAnimationStart :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onAnimationStart f = unsafeMkProps "onAnimationStart" (handle f)

onAnimationEnd :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onAnimationEnd f = unsafeMkProps "onAnimationEnd" (handle f)

onAnimationIteration :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onAnimationIteration f = unsafeMkProps "onAnimationIteration" (handle f)

onTransitionEnd :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onTransitionEnd f = unsafeMkProps "onTransitionEnd" (handle f)

onLoad :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onLoad f = unsafeMkProps "onLoad" (handle f)

onCopy :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onCopy f = unsafeMkProps "onCopy" (handle f)
Expand Down Expand Up @@ -498,6 +518,10 @@ onInput :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onInput f = unsafeMkProps "onInput" (handle f)

onInvalid :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onInvalid f = unsafeMkProps "onInvalid" (handle f)

onSubmit :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onSubmit f = unsafeMkProps "onSubmit" (handle f)
Expand Down Expand Up @@ -593,3 +617,6 @@ onScroll f = unsafeMkProps "onScroll" (handle f)
onWheel :: forall eff props state result.
(Event -> EventHandlerContext eff props state result) -> Props
onWheel f = unsafeMkProps "onWheel" (handle f)

suppressContentEditableWarning :: Boolean -> Props
suppressContentEditableWarning = unsafeMkProps "suppressContentEditableWarning"