WTF is Svelte?
lessonDuration 1m 7sFree
Svelte is a tool for building fast web applications. In this lesson we're going to learn what is Svelte and what's the difference between Svelte and other frameworks such as React or Vue.
Browse
Find courses, lessons, articles, talks, and podcasts.
1,542 results for "react"
Showing 1,297–1,320 · Page 55 of 65
lessonDuration 1m 7sFree
Svelte is a tool for building fast web applications. In this lesson we're going to learn what is Svelte and what's the difference between Svelte and other frameworks such as React or Vue.
lessonDuration 1m 53s
Clone the course repository at: [https://github.com/learnwithjason/serverless-functions](https://github.com/learnwithjason/serverless-functions). In the repo, you'll want to start with the `start` branch. Preact is a JavaScript library that describes itself as a fast 3kB alternative to React with the same ES6 API. This is not a course on Preact. For this course, we'll be adding serverless functionality to a predefined Preact application in your local development environment. The Preact app contains static HTML and hardcoded data to get us started quickly. To run this application in your local development, execute the following command: `npm run dev.` That will open `localhost:5000`. You can interact with this application, but for the moment, the data is not persistent.
talk
Unfortunately, the JavaScript interview has turned into a, "who knows the buzzwords". Forget about your skills with React, CSS, or modern tooling, the real question is can you explain the Big O Notation of a binary search? This talk is designed to cover some of the most common buzzwords that you might be asked about in your next interview!
lessonDuration 5m 49s
In this lesson, you'll learn how to implement smooth image scrolling using React Spring's [useSpring hook](https://www.react-spring.io/docs/hooks/use-spring) You will use an `onMouseMove` event to get the image and mouse coordinates and `set` `useSpring` with the offset. You can then style the animated element with the `backgroundPositionX` and `backgroundPositionY` CSS properties.
talk
How many hours do we spend synchronizing our GraphQL API with our front end code? Whether it be updating types, writing the requests, making the react hooks, or all of the above, it quickly gets tedious. This talk will show you how you can let GraphQL code generators do the boring stuff.
lessonDuration 2m 12sFree
The [useEffect](https://reactjs.org/docs/hooks-effect.html) hook provides a way for components to declaratively state side effects that need to be run. By modifying the dependency array you can simulate certain React lifecycle methods such as `constructor`/`componentDidMount` and `componentDidUpdate` and `componentWillUnmount`. The `useEffect` hook is always called after the first render of your component and then any time its dependencies change. ### Examples ``` componentDidMount() { fetchData(); } ``` Is functionally equivalent to: ``` useEffect(() => { fetchData(); }, []) ``` Likewise this common approach: ``` componentDidUpdate(prevProps) { if (this.props.someProp !== prevProps.someProp) { handleChange(); } } ``` Can be replaced with the following hook: ``` useEffect(() => { handleChange(); }, [someProp); ``` --- There is also a cleanup phase that happens with hooks. If you return a function inside of a hook it will be executed just before the function is unmounted. This is similar to the `componentWillUnmount` hook and is explained in detail here: https://reactjs.org/docs/hooks-effect.html#effects-with-cleanup
lessonDuration 1m 53sFree
In this lesson we take all of the hooks and logic from our `<ExchangeRate>` component and put them into a custom hook called `useCurrencyCodes()`. What's the difference between a custom hook and a function we can use to organize our logic? Not much, really. Because custom hooks usually execute other hooks, they cannot be called conditionally (meaning we can't say `if (ready) useCustomHook()`). They must be called in the component's function body or in another custom hook. Redux hooks and React's built-in hooks are both included in our custom hook and work seamlessly together. Not only is it convenient to organize your logic in custom hooks, it makes them more sharable and testable as well. I don't recommend putting all of your logic into one large hook, but instead, consider where it would make your component easier to read by combining related hooks and logic into their own function. For more details about this pattern please check out this article from the React docs: https://reactjs.org/docs/hooks-custom.html
lessonDuration 2m 48sFree
With React hooks it's common to write callback functions in our component body. Event handlers are a common example of this. Most of the time they work great, however, when you're passing those event handlers down to a child component or using them as dependencies in another hook such as `useEffect` they can be a little bit tricky. Because the functions are re-created on every single render, the reference to that function changes. And each time it changes when it's used as a prop or a dependency, it will force an update. The [useCallback](https://reactjs.org/docs/hooks-reference.html#usecallback) hook was created to provide stable references to callback functions to avoid this problem. It's not always needed, but this lesson will show you how to use it when it's needed. In this lesson we start off by completing the conversion of our `<AmountField>` to using the Redux Hooks API, but in doing so introduce a new problem: our debouncing stops working. It turns out that by defining our dispatched action inline our `useMemo` hook was relying on an unstable function reference. Each time we changed the AmountField, we ended up creating a new debounced function and immediately firing off the call to update our rate table. To solve this problem we wrap our dispatched action function in `useCallback`. It's important to note that `useCallback` is not needed for every callback function you create and should only be used when there are real performance issues at hand.
lessonDuration 3m 12sFree
In this lesson I walk through each file in the application to demonstrate how it's all setup. This app uses [create-react-app](https://create-react-app.dev/) and there is organized in a fairly common way. We have a `components/` folders for our React components and all of the redux logic including `actions` and `reducers` live inside of a ` store/` folder. Each component in our application has one or both of [mapStateToProps](https://react-redux.js.org/api/connect#mapstatetoprops-state-ownprops--object) and [mapToDispatchToProps](https://react-redux.js.org/api/connect#mapdispatchtoprops-object--dispatch-ownprops--object) as well as both a react class component and [redux connected](https://react-redux.js.org/api/connect#connect-parameters) component which we call a "container" component. We also cover how we get our exchange rate data using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and [exchangeratesapi.io](https://exchangeratesapi.io/). **Note:** This lesson is definitely optional if you're already confident in how a redux app is setup.
lessonDuration 1m 32sFree
In this lesson we replace `React.createRef()` with the `React.useRef` hook. The API is almost identical, so the there's not much to it, if you're already familiar with refs. In React, refs provide a way to store references to native DOM elements. Throughout React's evolution there have been several variations on the pattern including [callback refs](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) and [string refs](https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs). With functional components you'll only want to be using the `useRef()` hook to create your refs. One other thing to note about refs is that you can only pass them in to *class components* and *built-in components* (such as `<div>`). If you need to pass a `ref` into a function components check out the [forwardRef](https://reactjs.org/docs/forwarding-refs.html#gatsby-focus-wrapper) API. --- **Callback Refs** This lesson does not cover callback refs, but if you have one like this one and you wanted to migrate it to `useRef()` ``` class MyComponent extends React.Component { render() { return ( <input type="text" ref={el => this.inputRef = el} /> ) } } ``` It would look like this: ``` function MyComponent() { const inputRef = useRef(); return <input type="text" ref={inputRef} /> } ```
lessonDuration 2m 45sFree
Why does Gatsby use GraphQL? This is part 1 of a 4-part series that shows how to create pages in Gatsby, how data becomes hard to manage over time, and how GraphQL helps limit the complexity of data management. Let's create a page using React component templates and no data at all.
lessonDuration 7m 28s
For your front end, a VueJs application has been created from the CLI. VueJS, just like React and Angular applications have a development mode as well as a production mode. Once you are ready to deploy this application, you won’t want to use the same code as you do when you develop. In fact, you will need to run another script to build a production application. This script will take all of your JavaScript files and merge everything into a single minified JavaScript file. It will do the same for your CSS. By doing so, you will end up with a minimal set of files that can be served over any static file webserver. In this case, you will be using an Nginx server to serve those files. Nginx is an open-source, high-performance HTTP server that will be able to handle many requests to your front end. We'll do this with a multi-step build in a Dockerfile that will discard the first container that we use to build the source code and run it in a container that's built on top of the nginx image.
lessonDuration 7m 56s
Learn how to make the store object available to all components by using the advanced React feature called “context”.
lessonDuration 1m 20s
In this lesson, we’ll write a simple toggle component which will serve as the foundation for the rest of the course. Kent walks through how to create a simple toggle with React `setState`. He shows us how to extend the functionality of the toggle by safely adding an `onToggle` prop that gets called after state is updated.
lessonDuration 47sFree
In this video lesson, you gonna learn how to get started with the basic NextJS web app from scratch. You will be using NextJS React Framework as it’s a modern standard used nowadays in lots of applications. The main reason of choosing NextJS is the lack of initial configuration we need to set up for things to “just work”
lessonDuration 5m 23sFree
In this video you'll learn how to create a new Apollo client in a React application & query for data from a GraphQL API using the Apollo GraphQL Hooks library.
lessonFree
This is a workshop that Joe held in preparation for Shareable Custom Hooks in React. Hooks are awesome because they're "first-class" utility functions provided by React to let you hook into state and other features while writing components. The cool thing about Hooks is that you can build on top of them to make your own. It’s like writing a function on top of lodash. You can gather something that might be reusable, and then package it up into a custom hook. That is the beauty of writing a shareable custom Hook in React.
lessonDuration 1h 25m
This is a planning session that Joe had with folks from egghead to plan out the initial outline of [Shareable Custom Hooks in React](https://egghead.io/courses/shareable-custom-hooks-in-react). We define the main outcomes, talk about rules of thumb when building custom react hooks, and then dig into the specific skills and concepts that will be needed to understand and apply this topic.
lessonDuration 3m 20sFree
Gatsby provides a React hook that lets us use static queries in our components. It's called (appropriately) `useStaticQuery`. In this lesson, you'll learn how to use `useStaticQuery` to get site metadata from your Gatsby config file.
lessonDuration 4m 16sFree
We want our applications to look good, and for that, we'll use standard CSS. In this lesson, we'll see how to load CSS files into a React application and how to apply classes from that CSS to the elements in our JSX.
lessonDuration 1m 23s
Concurrent Mode is a completely different rendering paradigm for React. It changes something that has remained constant since the first version of React: `ReactDOM.render`. To use Concurrent Mode, we use `ReactDom.createRoot`. It's API is slightly different then the old faithful `ReactDOM.render` but, with this one change, we can access the future of React.
lessonDuration 1m 38sFree
Welcome to this beginner level series on Alpine JS! 👋🏞 Alpine JS is a rugged, minimal framework for composing JavaScript behaviour in your markup. It brings declarative, reactive, data-driven nature of libraries like React or Vue to your HTML templates. This is the series intro video. Let's get started!
lessonDuration 4m 29sFree
In React, our UI is a function of state (and props). In this lesson, we'll create some internal state and pass some props into a class component and use them together to render some UI in the class component's `render` method.
lessonDuration 5m 24sFree
Gatsby is an incredible tool for building static web apps using React. In this lesson, you will learn how to use Gatsby's node API's to render paginated news items.