All Projects → hobofan → reacty_yew

hobofan / reacty_yew

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
Generate Yew components from React components via Typescript type definitions

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to reacty yew

portfolio
My Portfolio
Stars: ✭ 17 (-63.04%)
Mutual labels:  yew
react-calculator
📐 PWA React + Redux Calculator
Stars: ✭ 65 (+41.3%)
Mutual labels:  jsx
nornj
More exciting JS/JSX based on Template Engine, support control flow tags, custom directives, two-way binding, filters and custom operators.
Stars: ✭ 97 (+110.87%)
Mutual labels:  jsx
vuetify-tsx
Vuetify TSX is just a wrapper lib around vuetify components.
Stars: ✭ 20 (-56.52%)
Mutual labels:  jsx
math-magicians
Website for all fans of mathematics. It is a Single Page App (SPA) that allows users to make simple calculations. read a random motivation-related quote and write a to-do list.
Stars: ✭ 22 (-52.17%)
Mutual labels:  jsx
react-jsx-renderer
A React component for Rendering JSX
Stars: ✭ 43 (-6.52%)
Mutual labels:  jsx
Yew-WebRTC-Chat
A simple WebRTC chat made with Yew
Stars: ✭ 112 (+143.48%)
Mutual labels:  yew
adobe-discord-rpc
Discord Rich Presence extension for your adobe apps!
Stars: ✭ 383 (+732.61%)
Mutual labels:  jsx
crud-app
❄️ A simple and beautiful CRUD application built with React.
Stars: ✭ 61 (+32.61%)
Mutual labels:  jsx
ExtendScript-for-Visual-Studio-Code
Extension that adds Adobe ExtendScript support to Visual Studio Code
Stars: ✭ 29 (-36.96%)
Mutual labels:  jsx
react-ui-components
React UI Components (npm @assenti/rui-components)
Stars: ✭ 21 (-54.35%)
Mutual labels:  jsx
vue3-jd-h5
🔥 Based on vue3.0.0, vant3.0.0, vue-router v4.0.0-0, vuex^4.0.0-0, vue-cli3, mockjs, imitating Jingdong Taobao, mobile H5 e-commerce platform! 基于vue3.0.0 ,vant3.0.0,vue-router v4.0.0-0, vuex^4.0.0-0,vue-cli3,mockjs,仿京东淘宝的,移动端H5电商平台!
Stars: ✭ 660 (+1334.78%)
Mutual labels:  jsx
fjb
fast javascript bundler 📦
Stars: ✭ 103 (+123.91%)
Mutual labels:  jsx
ECHI VUE TODO
使用 Vue 开发的一款 TODO 应用,包含登录、待办、日程、历史事项、回收站。项目较为小型,适合进阶学习使用(💡请注意,项目大量使用 jsx 进行开发)。
Stars: ✭ 19 (-58.7%)
Mutual labels:  jsx
ink-box
Styled box component for Ink
Stars: ✭ 113 (+145.65%)
Mutual labels:  jsx
studybuddy-web
📚 Website for all the study materials for IIITV curriculums 🎉
Stars: ✭ 17 (-63.04%)
Mutual labels:  jsx
real-async-trait-rs
A proc macro for real async traits, using nightly-only existential types and generic associated types to work around the need for type erasure
Stars: ✭ 38 (-17.39%)
Mutual labels:  proc-macro
next-boilerplate
📐 A modern universal boilerplate for React applications using Next.js.
Stars: ✭ 15 (-67.39%)
Mutual labels:  jsx
BarterOnly
An ecommerce platform to buy or exchange items at your convenience
Stars: ✭ 16 (-65.22%)
Mutual labels:  jsx
babel-plugin-hyperscript-to-jsx
This plugin transforms react-hyperscript into JSX. Intended to be used as codemod.
Stars: ✭ 20 (-56.52%)
Mutual labels:  jsx

reacty_yew - Generate Yew components from React component via Typescript type definitions

This is a proof of concept for automatically generating Yew components from React components that have Typescript type definitions. Many parts are missing and this likely shouldn't be used in production!

Announcement blog post with a bit more information

Showcase

For the full example see ./examples/bad_button.

Given a React component:

import * as React from "react";

interface BadButtonProps {
  color?: string,
  text: string,
}

const BadButton = (props: BadButtonProps): JSX.Element => {
  return (
    <button
      style={{ backgroundColor: props.color }}
      onClick={() => window.alert("Click!")}
    >
      {props.text}
    </button>
  );

};

export { BadButton };

An invocation of the react_component_mod! macro (takes as input the name of the module to generate, path to the type declarations and the JS global (UMD) that holds the React components) generates a module:

react_component_mod!(
    bad_button;
    types = "../js_package/dist/index.d.ts",
    global = "BadButtonLib"
);

You can directly use the generated component BadButton in a Yew component:

use yew::prelude::*;
use crate::bad_button::BadButton;

// ...
fn view(&self) -> Html {
    html! {
        <div>
            <BadButton text="Actual props" />
        </div>
    }
}
// ...
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].