So I've been setting up my portfolio, as a jr fullstack web developer. I've ran into a little trouble with react and an onClick link to an external website(my github.) I've got a card where I've passed it a {link} prop, or atleast I think that's how I've set it up lol. The goal is to set up my card to where when you click on it, it takes you to my github / hosted projects. Any advice/ guidance is greatly appreciated.
This is my card where I want to be able to click and redirect users to my github / hosted projects
This is where I've set up my {link} prop
This is my list of projects where I map through the array and display my cards
Related
I'm displaying 9 cards on my home page. each card contains an Image,link and description.
everytime I'm clicking on home, page is being loaded after few seconds. to show information on those cards I'm using an API call in useEffect.
Question is: when I'm clicking on Home button, is it calling that API again n again ?
if yes, can we stop that calling ? like store all information at a place and then use it again ??
for that purpose, I guess we use Redux, right?
I just need some light on this scenario.
thanks,
I'm trying to create a personal blogging website, where I'll be putting local news snippet.
as I'm learning, trying to implement this project using React.js.
My app displayed a grid of pokemons, I have retrieved the data from axios and fed it to a FlatList in React Native (Below)
I want each of these pokemons to be buttons which leads to the next page (Below)
I have no idea on how to do this. I'm assuming I have to create an 'onPress' function inside the Flatlist? Or React routing but not sure could someone shed some light into this?
Thanks
Basically, you need a lib to do that. I've been using React Navigation. You can follow its tutorial here https://reactnavigation.org/docs/hello-react-navigation
I am relatively new to the React world and struggling to find a way to load IconButtons to the toolBar of an AppBar (from Material UI).
Say I am on pageA and like to have two IconButtons specific to pageA and when I got to pageB, I like to have the toolBar buttons loaded that are specific to pageB.
I have created a codesandbox project to make it easier for anyone to help.
https://codesandbox.io/s/material-ui--react-admin-1qc5x
I appreciate any help, guidance etc.
you can achieve this by multiple ways:
Redux: you can use react-redux and create a store where you can store your current_page value (best practice in case of SPA) and access the page value in
static getDerivedStateFromProps(props, state){
//your code here
}
Based on Route(react-router)
[what i have done] based on URL params as you are doing history.push so it will be easier to extract the params from your URL and based on that render your Toolbar Icons.
My code reference: https://codesandbox.io/s/material-ui--react-admin-nxh7m
I'm building an app with vue-router and trying to achieve a UI similar to that of (the now defunct) Google Inbox. Or the Techcrunch homepage, which is possibly a better rendition of what I need.
there's a list of items
when you click on one of those items, it "expands in place" to display more details.
the URL also updates to reflect the expanded item
when clicking "back" the item collapses back into the list
when accessing the URL directly, the page should display the expanded item, and (optionally) could display more list items below.
Thing is, I can't figure out how I would build this - I'm trying to start from the idea of child routes, but I don't know where to place the child <router-view> since its location will always be dynamic based on which item was just clicked in order to expand.
I have a hunch it's related to named views but I can't wrap my head around it.
Any ideas welcome!
A similar topic came up on the Vue github page a while back, but involving the opening of modals as opposed to opening collapsing containers. One of the contributors to that thread wrote a pretty good blog post that might point you to a solution.
Once you get the dynamic routing sorted as they did above for modals, swapping the blurb for the article and animating the expansion should be fairly simple. The Vue docs cookbook has a good article on building a dynamic blog that should come in handy as well.
I'm building a single page application with React and Backbone and am trying to figure out best practices for handling navigation between content in the app. My app will have a sidebar with links, for example, to "photos" and "settings". The sidebar is always present, so upon clicking "settings" I want the settings component to be rendered without the entire page reloading. Slack is a great example of what I'm looking for, where clicking a different channel switches the conversation content, but does not reload the entire page.
I had a few ideas on how to implement this, but i'm not sure what's best:
Have a general react component (console.jsx) that accepts a urlparameter as a prop to determine which content (photos or settings) to render.
or 2. have a general react component and define a state variable that represents which content to render.
Any help would be greatly appreciated!
Have you heard about react router? Seems to be what you want.
react router