Coder Social home page Coder Social logo

yazaabed / react-tabs Goto Github PK

View Code? Open in Web Editor NEW
17.0 0.0 8.0 2.09 MB

Simple React Tabs using the new react ContextAPI

Home Page: https://codesandbox.io/s/frosty-pond-etcqj?file=/src/App.js

JavaScript 49.17% TypeScript 49.29% Shell 1.54%
react reactjs tabs state-management components react-tabs storybook rollup-example

react-tabs's People

Contributors

yaabed avatar yazaabed avatar

Stargazers

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

react-tabs's Issues

onClick hook & dynamic active tab ?

Hi, simple and great library, but actually it misses some essential functionality

  • i want to trigger my custom function whenever i click the title tab
  • i also want to dynamically active tab from my current active state

how can i achieve these things ?

Warning: Failed prop type

Warning: Failed prop type: Tabs: prop type activeTab is invalid; it must be a function, usually from the prop-types package, but received object.
in Tabs (at HomeBody.jsx:22)
in HomeBody (created by ConnectFunction)
in ConnectFunction (at Homepage.jsx:14)
in section (at Homepage.jsx:12)
in div (at Homepage.jsx:10)
in Homepage (created by Context.Consumer)
in Route (at App.js:12)
in Switch (at App.js:11)
in div (at App.js:10)
in App (at src/index.js:32)
in AuthIsLoaded (at src/index.js:31)
in Router (created by BrowserRouter)
in BrowserRouter (at src/index.js:30)
in ReactReduxFirebaseProvider (at src/index.js:29)
in Provider (at src/index.js:28)
in StrictMode (at src/index.js:27)

Okay I followed the demo but getting this warning

Warning in console

Warning: Cannot update during an existing state transition (such as within render). Render methods should be a pure function of props and state.

package.json

"react": "^16.4.2",
"react-dom": "^16.4.2",

or

"react": "^16.5.2",
"react-dom": "^16.5.2",

or

"react": "^16.6.3",
"react-dom": "^16.6.3",

Warning in console

image

Code:

               <Tabs
                  activeTab={{
                    id: "tab1"
                  }}
                >
                  <Tabs.Tab id="tab1" title="English">
                    <div style={{ padding: "20px 0" }}>
                      <RightpanelEnglish />
                    </div>
                  </Tabs.Tab>
                  <Tabs.Tab id="tab2" title="Hindi">
                    <div style={{ padding: 10 }}>This is tab 2</div>
                  </Tabs.Tab>
                </Tabs>

Also, how can i update the style of tab such as blue line thickness, the colour of the font ?

P.S
Great package, helping me alot

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.