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

Mitosis Quickstart button does not work with react-native button #1646

Open
1 of 12 tasks
NickersWeb opened this issue Nov 22, 2024 · 0 comments
Open
1 of 12 tasks

Mitosis Quickstart button does not work with react-native button #1646

NickersWeb opened this issue Nov 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NickersWeb
Copy link

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

https://mitosis.builder.io/playground/?code=KYDwDg9gTgLgBAE2AMwIYFcA29noHYDGMAlhHnAMLoDOMEAtgELox14AUAlHAN4BQcOFGAx0UcgB4ARizZwyFTMQIBrALw8ucNQD44BMtQiZgAOkwQA5uwBEMYLRucAvjoCCCBBID0M1mR0Abj5nPiA%3D

Expected Behaviour

That react-native output should have no bugs for a simple Mitosis button.

Actual Behaviour

Following this guide: https://mitosis.builder.io/docs/quickstart/.

react-native output does not match the related playground link.

Instead, it creates the following:

import {
  FlatList,
  ScrollView,
  View,
  StyleSheet,
  Image,
  Text,
  Pressable,
  TextInput,
  TouchableOpacity,
  Button,
  Linking,
} from "react-native";

function CustomButton(props: any) {
  return (
    <Button onPress={(event) => console.log("test")}>
      <Text>Add</Text>
    </Button>
  );
}

export default CustomButton;

It should use Pressable instead.

Additional Information

/**
 * @type {import('@builder.io/mitosis').MitosisConfig}
 */
module.exports = {
  files: "src/**",
  targets: ["react", "reactNative"],
  dest: "packages",
  commonOptions: {
    typescript: true,
  },
  options: {
    react: {
      stylesType: "style-tag",
    },
    reactNative: {},
    svelte: {},
    qwik: {},
  },
};

@NickersWeb NickersWeb added the bug Something isn't working label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant