Skip to content
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

Support sub tree as component props for mini-react and vue #88

Closed
henrytao-me opened this issue May 21, 2021 · 1 comment
Closed

Support sub tree as component props for mini-react and vue #88

henrytao-me opened this issue May 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@henrytao-me
Copy link
Member

henrytao-me commented May 21, 2021

What?

Sub tree (fragment) as component props is supported in vanilla js and react since this PR #73. mini-react and vue need to have similar support as well.

Sample of sub tree in React (prefix prop):

import {useState, createContext, useContext, useEffect, useMemo} from 'react';
import {
  render,
  Button as ReactButton,
  Text as ReactText,
} from '@shopify/argo-checkout-react';

function App() {
  const [count, setCount] = useState(0);
  const [toggle, setToggle] = useState(true);

  return (
    <>
      <ReactButton
        fill
        onPress={() => setCount((count) => count + 1)}
        prefix={toggle && <ReactText>Prefix {count}</ReactText>}
      >
        Press me! ({count})
      </ReactButton>
      <ReactButton fill onPress={() => setToggle(!toggle)}>
        Toggle fragment
      </ReactButton>
    </>
  );
}
render('Checkout::KitchenSink', () => <App />);
@henrytao-me henrytao-me added the enhancement New feature or request label May 21, 2021
@lemonmade
Copy link
Member

mini-react and the dedicated Vue bindings have been removed as part of refactoring remote-ui onto the DOM.

@lemonmade lemonmade closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants