Giter Site home page Giter Site logo

react-bootstrap-typescript's Introduction

React-Bootstrap

Bootstrap 5 components built with React.

GitHub Actions CI status Travis CI Build status npm Codecov Discord Netlify

Bootstrap compatibility

React-Bootstrap is compatible with various versions of Bootstrap. As such, you need to ensure you are using the correct combination of versions.

See the below table on which version of React-Bootstrap you should be using in your project.

Bootstrap Version React-Bootstrap Version Documentation
v5.x 2.x Link
v4.x 1.x (not maintained) Link
v3.x 0.33.x (not maintained) Link

Migrating from previous versions

Bootstrap 4 to Bootstrap 5

If you would like to update React-Bootstrap within an existing project to use Bootstrap 5, please read our docs for migrating to React-Bootstrap V2.

Bootstrap 3 to Bootstrap 4

If you would like to update React-Bootstrap within an existing project to use Bootstrap 4, please read our docs for migrating to React-Bootstrap V1.

Related modules

Local setup

Yarn is our package manager of choice here. Check out setup instructions here if you don't have it installed already. After that you can run yarn run bootstrap to install all the needed dependencies.

From there you can:

  • Run the tests once with yarn test (Or run them in watch mode with yarn run tdd).
  • Start a local copy of the docs site with yarn start
  • Or build a local copy of the library with yarn run build

CodeSandbox Examples

Click here to explore some React-Bootstrap CodeSandbox examples.

Click here to automatically open CodeSandbox with the React-Bootstrap CodeSandbox Examples GitHub Repository as a workspace.

Contributions

Yes please! See the contributing guidelines for details.

react-bootstrap-typescript's People

Contributors

christhomas avatar eyn avatar gnain avatar iamsaksham avatar johnnyreilly avatar kpes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-bootstrap-typescript's Issues

How to import specific component from react-bootstrap with Typescript

Earlier my app was in ReactJs + React-bootstrap. Now I'm using Typescript + ReactJs + React-bootstrap

To reduce the size of the app for production Earlier I used to import react-bootstrap components using - import Button from 'react-bootstrap/lib/Button'

After adding Typescript it shows the following error

ERROR in [at-loader] ./components/Hello.tsx:6:8
TS1192: Module ''react-bootstrap/lib/Button'' has no default export.

Attempt 1

import {Button} from 'react-bootstrap/lib/Button' but in this case Button is undefined.

Attempt 2

import * as Button from 'react-bootstrap/lib/Button' but in this case another error pops out

ERROR in [at-loader] ./components/Hello.tsx:54:12
TS2604: JSX element type 'Button' does not have any construct or call signatures.

This error shows error in line <Button bsStyle="danger" bsClass="glyphicon glyphicon-new-window"></Button>

Though import {Button} from 'react-bootstrap' works fine but this is not desired because it results in increasing the size of the app by 200kbs for me.

How can we import specific component from react-bootstrap using Typescript??

I can't find TableRow and Table Col

I am able to use the Table but I can't find TableRow or TableCol. How do we use Table with this package? Thanks.

import { Table } from 'react-bootstrap';

Table does not support "fill" property

The Table component, should according to the docs, support the "fill" attribute, I have tested that modifying the d.ts file for the Table to be like as follows, it will work.

export interface TableProps extends React.Props<TableClass> {
  bordered?: boolean;
  className?: string;
  condensed?: boolean;
  hover?: boolean;
  responsive?: boolean;
  striped?: boolean;
  fill?: boolean;
}

No version number

It would be useful to have a version number for the version of React Boostrap these typing describe.

bs-Properties are not supported in type definitions

I am trying to convert my bootstrap-react app to TypeScript. Almost everything works fine, but all of the "bs" attributes are not present in the type definitions.
I regularly use "bsClass" and "bsSize" on all react-bootstrap controls, but I get an "property does not exist" error from the ts compiler.
How would I go for that?

Guenter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.