Giter Site home page Giter Site logo

ger86 / react-portals-wormhole Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4.22 MB

In this project I want to show you how we can use React Portals to create impressive features like a wormhole.

Home Page: https://medium.com/@ger86/react-portals-una-introduccion-29c296324334

License: GNU General Public License v3.0

HTML 38.32% CSS 16.15% JavaScript 45.53%
reactjs react react-developers react-hooks react-hook useref react-portal

react-portals-wormhole's Introduction

🕳 React Portals: Creating a wormhole

Description

In this project I want to show you how we can use React Portals to create amazing features like a wormhole.

What we will do is set a draggable spaceship that we could move around the screen and place into a wormhole to go to another part of the screen. This feature is achieven using React Portals and the hook useRef to maintain a reference to the two wormholes.

You will learn

Use React Portals to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

Use useRef hook to keep references to DOM elements.

Use the library (React Draggable)[https://www.npmjs.com/package/react-draggable] to move the spaceship around the screen.

Run the project

Use yarn start to run the app in the development mode and open http://localhost:3000 to view it in the browser.

To read more

react-portals-wormhole's People

Contributors

ger86 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.