Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { useState, useEffect, useRef } from 'react'
- import { getImage } from '../pages'
- import { elm } from '../../scripts/test.js'
- import { useParams } from 'react-router-dom'
- const Test = ( props ) => {
- const [ image, setImage ] = useState( false )
- const [ loading, setLoading ] = useState( false )
- console.log( 8881111, props.items )
- useEffect(() => {
- load( '/assets/images/static/loading.gif' );
- test( '/assets/images/static/test/lotto649-canada-logo.png' );
- }, [])
- const test = async ( url ) => {
- getImage( url )
- .then(blob => {
- let img =
- <img
- src={ URL.createObjectURL( blob ) }
- alt='add something here.'
- width='1232px'
- height='765px'
- />
- setImage( img )
- });
- }
- const load = async ( url ) => {
- getImage( url )
- .then(blob => {
- let img =
- <img
- src={ URL.createObjectURL( blob ) }
- alt='add something here2.'
- width='auto'
- height='auto'
- />
- setImage( loading )
- });
- }
- return (
- <React.Fragment>
- <div>THE TEST PAGE</div>
- { loading }
- { image }
- </React.Fragment>
- );
- }
- export default Test;
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement