0

Hi everyone and thank you for your time.

I'm trying to use Semantic-ui-React with React Spring, here i have a brief example...


import React from 'react'
import {Segment, Header} from "semantic-ui-react"
import {useSpring, animated, config} from "react-spring"
function Semantix() {

    const fading = useSpring({ config: config.slow,

        from : {
            opacity : 0,
            marginLeft:"-50px"
        },
        to : {
            opacity : 1,
            marginLeft: "300px"
        }
    })



    return (
        <Segment>
            <animated.Header style={fading}>Hey Hey</animated.Header>
        </Segment>
    )
}

export default Semantix



My sincere apologies for such silly question, but i'm a bit desperate at the time, any help would be appreciate

1 Answers1

1

In the animated only the native elements are there as a constants, like animated.div. You have to use animated as a function to other non native element such a component from semantic-ui: animated(Header)

  const AnimatedHeader = animated(Header);

  return (
    <Segment>
      <AnimatedHeader style={fading}>Hey Hey</AnimatedHeader>
    </Segment>
  );
Peter Ambruzs
  • 7,763
  • 3
  • 30
  • 36