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

prevent main tsx code from disappearing completely #28

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

ayodeji-ti
Copy link

For an invalid code, the app now displays // 🚨 Your props contains invalid code but also with the unformated invalid code under it e.g

// 🚨 Your props contains invalid code

import React, { RefObject } from 'react'
import { ChakraProvider, Box, Center, Button, Text } from '@chakra-ui/react'

type AppPropsTypes = { muName: string }

const App = ({ muName }: AppPropsTypes) => (
 <ChakraProvider resetCSS>
 <Center
    display="flex"  flexDirection="column"
      alignItems="center"
      justifyContent="flex-start"
      m={16}
      p={8}
      backgroundColor="cyan.100"
      bgGradient="linear(to right, green.200,blue.500)"
    >
      <Text opacity={1} fontWeight="bold" fontSize="lg" letterSpacing="widest">
        Some t blah blah blah
      </Text>
      <Button
        variant="ghost"
        size="md"
        bgGradient="linear(to right, messenger.500,green.500)"
        borderRadius={100}
        border={20}
      >
        Test button
      </Button>
    </Center>
  </ChakraProvider>
)

export default App

This way, if the code in the main tsx is invalid, the whole code won't just disappear like it did when we were having our final presentation, we will just have this comment on the first line, and the unformatted code below it.
Screenshot (413)

@ayodeji-ti ayodeji-ti merged commit a0fa0fd into master Nov 21, 2022
@ayodeji-ti ayodeji-ti deleted the fix/logic-code branch November 21, 2022 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants