score:1
Accepted answer
you could set a wrapper for the anchors
and change the color of the wrapper instead on your scroll functionality, while setting the color
of the anchors to inherit
. this way the anchors will always inherit the color you set on the wrapper, even when visited.
const usestyles = makestyles((theme) => ({
...
links: {
textdecoration: 'none',
color: 'inherit'
},
...
}));
and then for the links you simply add the class:
<a href="/contact" classname={classes.links}>
<h2 classname={classes.appbartitle2}>sales</h2>
</a>
hope this was helpful.
Source: stackoverflow.com
Related Query
- How to change React Appbar links from purple
- CDN links for React packages and how to import it when using react using the scripts from CDN
- How to make AppBar component from material-ui-next react to scroll events
- how and when to call a react component methods after state change from redux
- How to use React Native Animate to change view flex from 0 to 1
- How to wait for a Redux action to change state from a React component
- How can I change the default port in react from 3000 to another port?
- How do I add AppBar with Back to Top button from Material UI for React in my App?
- React How to change state value from child to Parent using useState and useContext
- How to remove selected index of an array from the DOM and reflect the change in React state?
- How do you change state of a react component from a different component?
- How to parse Embeddable Links from Markdown and render custom React Components
- How to change React component from outside?
- how to catch react router change event from outside page
- How can i remove a Property from a react component on router path change
- How to change tab from parent in react material Tabs
- How do I tell React component to change its state when an event is triggered from third party lib?
- How do I change a property from an array of objects when setting React state?
- How to change the selection of input From UserName To PassWord in React js
- How to change only a part of the state from child component react hooks
- Is this the correct way to show data in React from a fetch request, if not how do I change JSX being rendered to a component?
- How to trigger state change from child to parent in React Hooks?
- how to change the width of react player from its default
- How to change style from react bootstrap scss file?
- How can I stop my React app from re-rendering when I change language?
- How to change State from inside .Map function React
- React Bootstrap: How can I change the icon of Dropdown.Toggle from the arrow icon to some other icons from React Icon?
- How to change state of modal from a different component in react
- How to change element after render from .map method in React
- How to change state of parent from nested child in React Hooks?
More Query from same tag
- React JS - Invariant violation error while using HOC
- ASP.NET Core DateTime Rest API with Javascript converts to UTC instead of java
- TypeError: Cannot read property 'javascript' of undefined + terser webpack plugin + react js
- Redux-Form not running mapStateToProps function
- Why history.push does not work in route "/" in react?
- Using history mixin in ES6?
- How to edit environment variable for development and production?
- Checkbox status does not change in react
- How to obtain the timezone from open weather map and use it as a parameter using Vailla JS
- Passing a Nested Object as React.Component Props
- ReactJS: Rendering a list of request components
- React only display components of array properties that exist
- Caching with react-query and react-router-dom
- How to access property with a condition inside React.useState() and change it
- React use debounce with setState
- Reactjs setEmail is not a function onChange although it is function
- Fetch image in React from Node.js request
- how to make JavaScript cell take full row width
- What are context and updater arguments in the React library?
- Setting new state can change the data's color attribute, but not image
- Gatsby application that is SPA on mobile and has different routes on desktop
- Manage Multiple Audio Sources in React
- Materialize is not working with React, Webpacka. jQuery is not extended
- Api request with some data in reactjs
- Using a Storybook arg to set a nested arg
- Can't fixed too many re render issue in react hooks
- Eslint and prettier conflict on operator-linebreak rule
- How to make an array unique by object key?
- How to get the ref value in Higher order component?
- Add previous/next month buttons to Antd (Ant Design) calendar