diff --git a/bower.json b/bower.json index a218435..5e5e946 100644 --- a/bower.json +++ b/bower.json @@ -1,21 +1,21 @@ { - "name": "purescript-react-basic", - "license": [ - "Apache-2.0" - ], - "repository": { - "type": "git", - "url": "https://github.com/lumihq/purescript-react-basic" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output" - ], - "dependencies": { - "purescript-effect": "^v3.0.0", - "purescript-prelude": "^v5.0.0", - "purescript-record": "^v3.0.0" - } + "name": "purescript-react-basic", + "license": [ + "Apache-2.0" + ], + "repository": { + "type": "git", + "url": "https://github.com/lumihq/purescript-react-basic" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "output" + ], + "dependencies": { + "purescript-effect": "^4.0.0", + "purescript-prelude": "^6.0.0", + "purescript-record": "^4.0.0" + } } diff --git a/packages.dhall b/packages.dhall index d24232f..1b799e2 100644 --- a/packages.dhall +++ b/packages.dhall @@ -105,6 +105,7 @@ in upstream ------------------------------- -} let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.14.0/packages.dhall sha256:710b53c085a18aa1263474659daa0ae15b7a4f453158c4f60ab448a6b3ed494e + https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220510/packages.dhall + sha256:0b0d4db1f2f0acd3b37fa53220644ac6f64cf9b5d0226fd097c0593df563d5be in upstream diff --git a/src/React/Basic.js b/src/React/Basic.js index 3cb0263..264d3b3 100644 --- a/src/React/Basic.js +++ b/src/React/Basic.js @@ -1,28 +1,39 @@ -"use strict"; - -const React = require("react"); +import React from "react"; const createElement = React.createElement; const Fragment = React.Fragment; -exports.empty = null; - -exports.keyed = (key) => (child) => - createElement(Fragment, { key: key }, child); - -exports.element = (component) => (props) => - Array.isArray(props.children) - ? createElement.apply(null, [component, props].concat(props.children)) - : createElement(component, props); - -exports.elementKeyed = (component) => (props) => - createElement(component, props); - -exports.fragment = (children) => - createElement.apply(null, [Fragment, null].concat(children)); - -exports.createContext = (defaultValue) => () => - React.createContext(defaultValue); - -exports.contextProvider = (context) => context.Provider; - -exports.contextConsumer = (context) => context.Consumer; +export const empty = null; + +export function keyed(key) { + return (child) => + createElement(Fragment, { key: key }, child); +} + +export function element(component) { + return (props) => + Array.isArray(props.children) + ? createElement.apply(null, [component, props].concat(props.children)) + : createElement(component, props); +} + +export function elementKeyed(component) { + return (props) => + createElement(component, props); +} + +export function fragment(children) { + return createElement.apply(null, [Fragment, null].concat(children)); +} + +export function createContext(defaultValue) { + return () => + React.createContext(defaultValue); +} + +export function contextProvider(context) { + return context.Provider; +} + +export function contextConsumer(context) { + return context.Consumer; +} diff --git a/src/React/Basic/StrictMode.js b/src/React/Basic/StrictMode.js index c0b58ae..f4fad04 100644 --- a/src/React/Basic/StrictMode.js +++ b/src/React/Basic/StrictMode.js @@ -1,5 +1,2 @@ -"use strict"; - -const React = require("react"); - -exports.strictMode_ = React.StrictMode; +import React from "react"; +export const strictMode_ = React.StrictMode;