React.Basic.DOM
- Package
- purescript-react-basic
- Repository
- lumihq/purescript-react-basic
This module defines helper functions for creating virtual DOM elements safely.
Note: DOM element props are provided as records, and checked using Union
constraints. This means that we don't need to provide all props, but any we
do provide must have the correct types.
#hydrate' Source
hydrate' :: JSX -> Element -> Effect Unit -> Effect Unit
Render or update/re-render a component tree into a DOM element, attempting to reuse the existing DOM tree. The given Effect is run once the DOM update is complete.
Note: Relies on ReactDOM.hydrate
, generally only
used with ReactDOMServer.renderToNodeStream
or
ReactDOMServer.renderToString
#findDOMNode Source
findDOMNode :: ReactComponentInstance -> Effect (Either Error Node)
Returns the current DOM node associated with the given instance, or an Error if no node was found or the given instance was not mounted.
Note: This function can be very slow -- prefer
React.Basic.DOM.Components.Ref
where possible
Note: Relies on ReactDOM.findDOMNode
#createPortal Source
createPortal :: JSX -> Element -> JSX
Divert a render tree into a separate DOM node. The node's
content will be overwritten and managed by React, similar
to render
and hydrate
.
#mergeStyles Source
mergeStyles :: Array CSS -> CSS
Merge styles from right to left. Uses Object.assign
.
For example:
style: mergeCSS [ (css { padding: "5px" }), props.style ]
Re-exports from React.Basic.DOM.Generated
#Props_track Source
type Props_track = (default :: Boolean, kind :: String, label :: String, src :: String)
#Props_title Source
type Props_title = (children :: Array JSX)
#Props_time Source
type Props_time = (children :: Array JSX)
#Props_thead Source
type Props_thead = (children :: Array JSX)
#Props_tfoot Source
type Props_tfoot = (children :: Array JSX)
#Props_textarea Source
type Props_textarea = (autoCapitalize :: String, autoCorrect :: String, children :: Array JSX, cols :: Number, defaultValue :: String, disabled :: Boolean, form :: String, name :: String, onChange :: EventHandler, placeholder :: String, required :: Boolean, rows :: Number, value :: String, wrap :: String)
#Props_template Source
type Props_template = (children :: Array JSX)
#Props_tbody Source
type Props_tbody = (children :: Array JSX)
#Props_svg Source
type Props_svg = (accentHeight :: String, accumulate :: String, additive :: String, alignmentBaseline :: String, allowReorder :: String, alphabetic :: String, amplitude :: String, arabicForm :: String, ascent :: String, attributeName :: String, attributeType :: String, autoReverse :: String, azimuth :: String, baseFrequency :: String, baseProfile :: String, baselineShift :: String, bbox :: String, begin :: String, bias :: String, by :: String, calcMode :: String, capHeight :: String, children :: Array JSX, clip :: String, clipPath :: String, clipPathUnits :: String, clipRule :: String, color :: String, colorInterpolation :: String, colorInterpolationFilters :: String, colorProfile :: String, colorRendering :: String, contentScriptType :: String, contentStyleType :: String, cursor :: String, cx :: String, cy :: String, d :: String, decelerate :: String, descent :: String, diffuseConstant :: String, direction :: String, display :: String, divisor :: String, dominantBaseline :: String, dur :: String, dx :: String, dy :: String, edgeMode :: String, elevation :: String, enableBackground :: String, end :: String, exponent :: String, externalResourcesRequired :: String, fill :: String, fillOpacity :: String, fillRule :: String, filter :: String, filterRes :: String, filterUnits :: String, floodColor :: String, floodOpacity :: String, focusable :: String, fontFamily :: String, fontSize :: String, fontSizeAdjust :: String, fontStretch :: String, fontStyle :: String, fontVariant :: String, fontWeight :: String, format :: String, from :: String, fx :: String, fy :: String, g1 :: String, g2 :: String, glyphName :: String, glyphOrientationHorizontal :: String, glyphOrientationVertical :: String, glyphRef :: String, gradientTransform :: String, gradientUnits :: String, hanging :: String, height :: String, horizAdvX :: String, horizOriginX :: String, ideographic :: String, imageRendering :: String, in :: String, in2 :: String, intercept :: String, k :: String, k1 :: String, k2 :: String, k3 :: String, k4 :: String, kernelMatrix :: String, kernelUnitLength :: String, kerning :: String, keyPoints :: String, keySplines :: String, keyTimes :: String, lengthAdjust :: String, letterSpacing :: String, lightingColor :: String, limitingConeAngle :: String, local :: String, markerEnd :: String, markerHeight :: String, markerMid :: String, markerStart :: String, markerUnits :: String, markerWidth :: String, mask :: String, maskContentUnits :: String, maskUnits :: String, mathematical :: String, mode :: String, numOctaves :: String, offset :: String, opacity :: String, operator :: String, order :: String, orient :: String, orientation :: String, origin :: String, overflow :: String, overlinePosition :: String, overlineThickness :: String, paintOrder :: String, panose1 :: String, pathLength :: String, patternContentUnits :: String, patternTransform :: String, patternUnits :: String, pointerEvents :: String, points :: String, pointsAtX :: String, pointsAtY :: String, pointsAtZ :: String, preserveAlpha :: String, preserveAspectRatio :: String, primitiveUnits :: String, r :: String, radius :: String, refX :: String, refY :: String, renderingIntent :: String, repeatCount :: String, repeatDur :: String, requiredExtensions :: String, requiredFeatures :: String, restart :: String, result :: String, rotate :: String, rx :: String, ry :: String, scale :: String, seed :: String, shapeRendering :: String, slope :: String, spacing :: String, specularConstant :: String, specularExponent :: String, speed :: String, spreadMethod :: String, startOffset :: String, stdDeviation :: String, stemh :: String, stemv :: String, stitchTiles :: String, stopColor :: String, stopOpacity :: String, strikethroughPosition :: String, strikethroughThickness :: String, string :: String, stroke :: String, strokeDasharray :: String, strokeDashoffset :: String, strokeLinecap :: String, strokeLinejoin :: String, strokeMiterlimit :: String, strokeOpacity :: String, strokeWidth :: String, surfaceScale :: String, systemLanguage :: String, tableValues :: String, targetX :: String, targetY :: String, textAnchor :: String, textDecoration :: String, textLength :: String, textRendering :: String, to :: String, transform :: String, u1 :: String, u2 :: String, underlinePosition :: String, underlineThickness :: String, unicode :: String, unicodeBidi :: String, unicodeRange :: String, unitsPerEm :: String, vAlphabetic :: String, vHanging :: String, vIdeographic :: String, vMathematical :: String, values :: String, vectorEffect :: String, version :: String, vertAdvY :: String, vertOriginX :: String, vertOriginY :: String, viewBox :: String, viewTarget :: String, visibility :: String, width :: String, widths :: String, wordSpacing :: String, writingMode :: String, x :: String, x1 :: String, x2 :: String, xChannelSelector :: String, xHeight :: String, xlinkActuate :: String, xlinkArcrole :: String, xlinkHref :: String, xlinkRole :: String, xlinkShow :: String, xlinkTitle :: String, xlinkType :: String, xmlBase :: String, xmlLang :: String, xmlSpace :: String, xmlns :: String, xmlnsXlink :: String, y :: String, y1 :: String, y2 :: String, yChannelSelector :: String, z :: String, zoomAndPan :: String)
#Props_summary Source
type Props_summary = (children :: Array JSX)
#Props_strong Source
type Props_strong = (children :: Array JSX)
#Props_span Source
type Props_span = (children :: Array JSX)
#Props_source Source
type Props_source = (media :: String, sizes :: String, src :: String, type :: String)
#Props_small Source
type Props_small = (children :: Array JSX)
#Props_section Source
type Props_section = (children :: Array JSX)
#Props_samp Source
type Props_samp = (children :: Array JSX)
#Props_ruby Source
type Props_ruby = (children :: Array JSX)
#Props_picture Source
type Props_picture = (children :: Array JSX)
#Props_optgroup Source
type Props_optgroup = (children :: Array JSX, disabled :: Boolean, label :: String)
#Props_noscript Source
type Props_noscript = (children :: Array JSX)
#Props_meta Source
type Props_meta = (content :: String, name :: String)
#Props_math Source
type Props_math = (children :: Array JSX)
#Props_mark Source
type Props_mark = (children :: Array JSX)
#Props_main Source
type Props_main = (children :: Array JSX)
#Props_legend Source
type Props_legend = (children :: Array JSX)
#Props_input Source
type Props_input = (accept :: String, alt :: String, autoCapitalize :: String, autoCorrect :: String, autoSave :: String, checked :: Boolean, defaultChecked :: String, defaultValue :: String, disabled :: Boolean, form :: String, height :: String, list :: String, max :: Number, min :: Number, multiple :: Boolean, name :: String, onChange :: EventHandler, pattern :: String, placeholder :: String, required :: Boolean, results :: String, size :: Number, src :: String, step :: String, title :: String, type :: String, value :: String, width :: String)
#Props_hgroup Source
type Props_hgroup = (children :: Array JSX)
#Props_header Source
type Props_header = (children :: Array JSX)
#Props_form Source
type Props_form = (accept :: String, action :: String, children :: Array JSX, method :: String, name :: String, onChange :: EventHandler, onInput :: EventHandler, onInvalid :: EventHandler, onSubmit :: EventHandler, target :: String)
#Props_figure Source
type Props_figure = (children :: Array JSX)
#Props_embed Source
type Props_embed = (height :: String, src :: String, type :: String, width :: String)
#Props_datalist Source
type Props_datalist = (children :: Array JSX)
#Props_colgroup Source
type Props_colgroup = (children :: Array JSX, span :: Number, width :: String)
#Props_code Source
type Props_code = (children :: Array JSX)
#Props_cite Source
type Props_cite = (children :: Array JSX)
#Props_body Source
type Props_body = (children :: Array JSX)
#Props_base Source
type Props_base = (href :: String, target :: String)
#Props_aside Source
type Props_aside = (children :: Array JSX)
#Props_article Source
type Props_article = (children :: Array JSX)
#Props_address Source
type Props_address = (children :: Array JSX)
#video Source
video :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_video) => Record attrs -> JSX
#track Source
track :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_track) => Record attrs -> JSX
#title Source
title :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_title) => Record attrs -> JSX
#time Source
time :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_time) => Record attrs -> JSX
#thead Source
thead :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_thead) => Record attrs -> JSX
#tfoot Source
tfoot :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_tfoot) => Record attrs -> JSX
#textarea Source
textarea :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_textarea) => Record attrs -> JSX
#template Source
template :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_template) => Record attrs -> JSX
#tbody Source
tbody :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_tbody) => Record attrs -> JSX
#table Source
table :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_table) => Record attrs -> JSX
#summary Source
summary :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_summary) => Record attrs -> JSX
#style Source
style :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_style) => Record attrs -> JSX
#strong Source
strong :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_strong) => Record attrs -> JSX
#span Source
span :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_span) => Record attrs -> JSX
#source Source
source :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_source) => Record attrs -> JSX
#small Source
small :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_small) => Record attrs -> JSX
#slot Source
slot :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_slot) => Record attrs -> JSX
#select Source
select :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_select) => Record attrs -> JSX
#section Source
section :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_section) => Record attrs -> JSX
#script Source
script :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_script) => Record attrs -> JSX
#samp Source
samp :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_samp) => Record attrs -> JSX
#ruby Source
ruby :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_ruby) => Record attrs -> JSX
#progress Source
progress :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_progress) => Record attrs -> JSX
#picture Source
picture :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_picture) => Record attrs -> JSX
#param Source
param :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_param) => Record attrs -> JSX
#output Source
output :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_output) => Record attrs -> JSX
#option Source
option :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_option) => Record attrs -> JSX
#optgroup Source
optgroup :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_optgroup) => Record attrs -> JSX
#object Source
object :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_object) => Record attrs -> JSX
#noscript Source
noscript :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_noscript) => Record attrs -> JSX
#meter Source
meter :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_meter) => Record attrs -> JSX
#meta Source
meta :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_meta) => Record attrs -> JSX
#math Source
math :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_math) => Record attrs -> JSX
#mark Source
mark :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_mark) => Record attrs -> JSX
#main Source
main :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_main) => Record attrs -> JSX
#link Source
link :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_link) => Record attrs -> JSX
#legend Source
legend :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_legend) => Record attrs -> JSX
#label Source
label :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_label) => Record attrs -> JSX
#keygen Source
keygen :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_keygen) => Record attrs -> JSX
#input Source
input :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_input) => Record attrs -> JSX
#iframe Source
iframe :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_iframe) => Record attrs -> JSX
#html Source
html :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_html) => Record attrs -> JSX
#hgroup Source
hgroup :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_hgroup) => Record attrs -> JSX
#header Source
header :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_header) => Record attrs -> JSX
#head Source
head :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_head) => Record attrs -> JSX
#form Source
form :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_form) => Record attrs -> JSX
#figure Source
figure :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_figure) => Record attrs -> JSX
#fieldset Source
fieldset :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_fieldset) => Record attrs -> JSX
#embed Source
embed :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_embed) => Record attrs -> JSX
#dialog Source
dialog :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_dialog) => Record attrs -> JSX
#details Source
details :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_details) => Record attrs -> JSX
#datalist Source
datalist :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_datalist) => Record attrs -> JSX
#data' Source
data' :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_data) => Record attrs -> JSX
#colgroup Source
colgroup :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_colgroup) => Record attrs -> JSX
#code Source
code :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_code) => Record attrs -> JSX
#cite Source
cite :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_cite) => Record attrs -> JSX
#canvas Source
canvas :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_canvas) => Record attrs -> JSX
#button Source
button :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_button) => Record attrs -> JSX
#body Source
body :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_body) => Record attrs -> JSX
#blockquote Source
blockquote :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_blockquote) => Record attrs -> JSX
#base Source
base :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_base) => Record attrs -> JSX
#audio Source
audio :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_audio) => Record attrs -> JSX
#aside Source
aside :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_aside) => Record attrs -> JSX
#article Source
article :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_article) => Record attrs -> JSX
#area Source
area :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_area) => Record attrs -> JSX
#address Source
address :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_address) => Record attrs -> JSX
#abbr Source
abbr :: forall attrs_ attrs. Union attrs attrs_ (SharedProps Props_abbr) => Record attrs -> JSX
Re-exports from React.Basic.DOM.Internal
#unsafeCreateDOMComponent Source
unsafeCreateDOMComponent :: forall props. String -> ReactComponent props