Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Creating a Button component in Typescript

$
0
0

I have to create a button component for my school project that should have an edit, cancel , save ("Save" should be shown in dropdown when clicking "..."). Everything should be in typescript and i have never had experience with TS (only React). Can someone help me like where should I start and so on. Every little help is appreciated even if it's one line of code or a youtube channel. There is not so much info out there about TS. 🙌 This is what I have come up until now.

import React from "react";//import "./Buttons.scss";type Props = {   color: string   open: boolean   //hideCancelBtn?: boolean   isValid: boolean   buttonTitle?: string;};export default function ButtonComponent (props: Props): JSX.Element {   const {color, open, hideCancelBtn, isValid, buttonTitle } = props}//en handleclick function return (<div className="AllButtons"><div className="cancel"><Button           className="button button--grey button--row-margin"           disabled={publishBtnInactive}           onClick={onDraftClick}>           cancel</Button></div>.........</div>) ```

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>