How is the Material-UI website creating a drop-down select in it's AppBar? - reactjs

I'm having trouble doing the same with my app. I've added a Select component, but it doesn't render correctly. Should I be using a different nested component to create this?
I cannot see an example in material-UI's documentation. I am not sure of the correct styles to use. I am using a Select component here, but I'm not sure if its the same the Material UI website is using as it doesn't seem to inherit the correct style. It would be great if someone can point me to the correct method of adding a drop-down to the Toolbar.

That "dropdown" is actually composed of Button Component and Menu Component.
The docs site is open-sourced and you can check the implementation here.

Related

Is it possible to pass className to React-Bootstrap Tab?

I have a tabbed navigation in a React app implemented using React-Bootstrap Tabs and Tab components. I can pass a custom className to Tabs, but if I try to do the same with the Tab component, it isn't added to its list of classes.
I haven't been able to find examples that do pass className to Tab, and there's no mention of this in the official documentation (though to be fair, being able to pass className to Tabs is also not really documented, except for in the examples).
Is it really not possible to pass a custom className to Tab? Any idea why this is not supported? Or, is there another way of doing that?

Hide certain navbar link items on service unavailable

I have a project that has a "service unavailable" component built in. Whenever this component is shown on a page, it is to hide certain navbar link items and only show a select few.
The navbar is also a separate component and each nav link item has it's own id.
Should I be using some like setState?
I'm new to react and any help is appreciated. If you need some code for me to add, also let me know.
I think global state is something you are looking for. Using redux you could easily set serviceUnavailable state and check it in navbar, and then render your links accordingly. You can learn more about approach, usage and installation here:
https://react-redux.js.org/

Nextjs Routing with activeClassName and Ant Design Menus

Potentially dumb question- Antd uses an selectedKeys field to determine which items inside a menu should be highlighted, and Nextjs uses an activeClassName parameter in the Link component to provide a class to be added when a page is currently active.
How does one best design a navigation page in Nextjs using the Ant Design menus and to reconcile these two approaches?
You can use nextjs withROuter to get the router object, use that to determinate which is the selectedKey

Material UI or Reactstrap

I need a frontend UI for my react web application and I was looking to Material UI and Reactstrap. Which one do you think is better and easier for begginers to understand? Also are there any tutorials for either them because I found both of their documentations confusing.
I am confused about how to incorporate the components and than customize them as well
About customizing them, there is a section explaining about it and they provide examples as well.
You only need to import the component you want and plug it to your React apps just like regular React component.
As for API part on Material UI, most of them consist of 3 parts (Props, CSS API, Demos) for each component. The props section provide you with all the available props for the corresponding component. For example the Button props API, it list all the available props you can provide for the Button component
CSS API section is the section you would want to look for when you want to customize the component, it list all the available keys for you to override, in my opinion it's best to look at the corresponding component implementation before customizing it because I find it a bit tricky. The source are available for public on their Github repo

React-Redux-Form nested component testing

I am using React-Redux-Form and React-Bootstrap on client side of application.
I'm stuck on how to testing my components. I have made a small project on github with one of my components named LoginModal:
https://github.com/DmitryIvanovIAMM/react-redux-form-login-test/blob/master/src/tests/Foo-test.js.
To start testing, I am following this tutorial https://www.codementor.io/vijayst/unit-testing-react-components-jest-or-enzyme-du1087lh8.
But when I try to .find() button in my rendered component, the result is an array of length zero. So I can't simulate its behaviour. I try find it (button) several different way but unsuccessful. Please, your suggestion.
This issue is with the rendering of Modal component that is part of #react-bootstrap. There is a discussion about it on https://github.com/react-bootstrap/react-bootstrap/issues/876.
The alternative is to use ReactModal from react-modal. Testing it is described on http://remarkablemark.org/blog/2017/05/17/testing-react-modal/

Resources