随笔分类 - React
摘要:Overriding a browser's current location without breaking the back button or causing an infinite redirect can be tricky sometimes. In this lesson we'll
阅读全文
摘要:React Router v4 allows us to render Routes as components wherever we like in our components. This can provide some interesting use cases for creating
阅读全文
摘要:We often want to render a Route conditionally within our application. In React Router v4, the Route components match the current route inclusively so
阅读全文
摘要:There are many cases where we will need a catch-all route in our web applications. This can include 404-style routes when nothing is match or other us
阅读全文
摘要:With React Router v4 the entire library is built as a series of React components. That means that creating nested Routes is as simple as creating any
阅读全文
摘要:React Router v4 ignores query parameters entirely. That means that it is up to you to parse them so that you can use that additional information as re
阅读全文
摘要:We can use regular expressions to more precisely define the paths to our routes in React Router v4. To add regex for router, we only need to add (), i
阅读全文
摘要:URLs can be looked at as the gateway to our data, and carry a lot of information that we want to use as context so that the user can return to a parti
阅读全文
摘要:We often need to be able to apply style to navigation links based on the current route. In React Router v4 you can easily accomplish this with the Nav
阅读全文
摘要:If you’ve created several Routes within your application, you will also want to be able to navigate between them. React Router supplies a Link compone
阅读全文
摘要:React Router 4 has several routers built in for different purposes. The primary one you will use for building web applications is the BrowserRouter. I
阅读全文
摘要:In CSS we use the descendant selector to style elements based on their nesting. Thankfully in React we don't need to consider this most of the time be
阅读全文
摘要:SASS Bootstrap allows us to configure theme or branding variables that affect all components (e.g. Primary Color or Link Color). When we isolate our s
阅读全文
摘要:In Flow, you can make global declarion about types. Run: It will generate .flowconfig file, open it and add few lines of configration. So it says that
阅读全文
摘要:Install: For example you have installed lodash libaray, and you want the defination file also, you can do: It will help to install the files automatic
阅读全文
摘要:We can use 'displayName' on component to change its component tag in dev tool: In dev tool:
阅读全文
摘要:React loves svg just as much as it loves html. In this lesson we cover how simple it is to make SVG components in ReactJS. Creating SVG components wit
阅读全文
摘要:Often when testing, you use the actual result to create your assertion and have to manually update it as you make changes to the feature. With Jest sn
阅读全文
摘要:We can utilize React.cloneElement in order to create new components with extended data or functionality. We render {items} below h2 tag, and for each
阅读全文
摘要:When you are using React components you need to be able to access specific references to individual component instances. This is done by defining a re
阅读全文