All Projects → noderaider → react-dom-inject

noderaider / react-dom-inject

Licence: MIT license
Binds an HTML element by selector to a ReactElement and renders to a DOM tree (with redux injection)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-dom-inject

Lambda Converters
Strongly-typed lambda expressions as value converters, data template selectors, and validation rules
Stars: ✭ 99 (+450%)
Mutual labels:  selector
Colored Time Selector
A smart colored time selector. Users can select just free time with a handy colorful range selector.
Stars: ✭ 156 (+766.67%)
Mutual labels:  selector
Redux Tiles
Composable way to create less verbose Redux code
Stars: ✭ 239 (+1227.78%)
Mutual labels:  selector
Pd Select
vue components ,like ios 3D picker style,vue 3d 选择器组件,3D滚轮
Stars: ✭ 101 (+461.11%)
Mutual labels:  selector
Actionclosurable
Extensions which helps to convert objc-style target/action to swifty closures
Stars: ✭ 120 (+566.67%)
Mutual labels:  selector
Goq
A declarative struct-tag-based HTML unmarshaling or scraping package for Go built on top of the goquery library
Stars: ✭ 192 (+966.67%)
Mutual labels:  selector
Resq
React Element Selector Query (RESQ) - Query React components and children by component name or HTML selector
Stars: ✭ 89 (+394.44%)
Mutual labels:  selector
WeightedRandomSelector
Very fast C# class for weighted random picking.
Stars: ✭ 117 (+550%)
Mutual labels:  selector
Css What
a CSS selector parser
Stars: ✭ 134 (+644.44%)
Mutual labels:  selector
V Selectpage
SelectPage for Vue2, list or table view of pagination, use tags for multiple selection, i18n and server side resources supports
Stars: ✭ 211 (+1072.22%)
Mutual labels:  selector
Dropdown
a lightweight dropdown of jQuery plugins
Stars: ✭ 105 (+483.33%)
Mutual labels:  selector
Dselectorbryant
单选滚动选择器、diy丰富、有阻尼效果、简单美观、触摸or点击模式 (Rolling Selector, Diy Rich, Damping Effect, Simple and Beautiful, Touch or Click Mode)
Stars: ✭ 109 (+505.56%)
Mutual labels:  selector
Jsonframe Cheerio
simple multi-level scraper json input/output for Cheerio
Stars: ✭ 196 (+988.89%)
Mutual labels:  selector
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (+455.56%)
Mutual labels:  selector
Bezierseekbar
Beautiful custom View, SeekBar selector, easy to use, and rich in customization.漂亮的区间选择器,贝塞尔曲线优雅实现
Stars: ✭ 252 (+1300%)
Mutual labels:  selector
Xselectorutil
一个可以用代码处理控件的阴影效果,及用代码在TextView、EditText、Button等控件设置selector背景(触摸反馈,样式变化、文字颜色变化、hint文字颜色变化等效果)的组件
Stars: ✭ 98 (+444.44%)
Mutual labels:  selector
React Native Input Spinner
An extensible input number spinner component for react-native highly customizable. This component enhance a text input for entering numeric values, with increase and decrease buttons.
Stars: ✭ 155 (+761.11%)
Mutual labels:  selector
smart-custom-element
Smart a lightweight web component library that provides capabilities for web components, such as data binding, using es6 native class inheritance. This library is focused for providing the developer the ability to write robust and native web components without the need of dependencies and an overhead of a framework.
Stars: ✭ 17 (-5.56%)
Mutual labels:  html-element
Swiftsoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
Stars: ✭ 3,079 (+17005.56%)
Mutual labels:  selector
Tristatetogglebutton
Customizable tri-state toggle button (with three states, three state toggle) for Android
Stars: ✭ 198 (+1000%)
Mutual labels:  selector

react-dom-inject

Binds an HTML element by selector to a ReactElement and renders to a DOM tree (with redux injection)

Install

npm i -S react-dom-inject

Usage

This package was written to ease transition of legacy applications from older systems component by component. It can be used to rewrite legacy components as react components, and then inject them into placeholder elements in the legacy application without requiring them to be in the same tree as the new react application.

index.html
<!-- ... -->

<!-- All data properties will be camelCased and injected into the components props object. Any innerHTML will be injected into the children element of your react component. -->
<div id="my-element" data-title="My Element!" data-color="#ff0000" data-default-visibility="false">
  <span>Some inner HTML to be injected here</span>
</div>

<!-- ... -->
MyReactElement.jsx
import React from 'react'
import ReactDOMInject from 'react-dom-inject'

/**
 * ReactElement to be injected.
 * This could be a regular class element but for this example I'm using an inline function style element.
 */
export const MyReactElement = props => {
  const { title, color, defaultVisibility, children, description } = props
  const style = { color
                , display: defaultVisibility ? 'block' : 'none'
                }
  return (
    <div style={style}>
      <h1>{title}</h1>
      <div>
        {children}
      </div>
    </div>
  )
}

export const MyReactElementDOM = ReactDOMInject(MyReactElement)

render.js

import { MyReactElementDOM } from './MyReactElement'

...

MyReactElementDOM.render('#my-element'[, { description: 'This is a way to pass properties to the element at render time.'[, state: reduxState ] } ])
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].