# Sketch using p5-wrapper-react not receiving props on route change but is receiving them on page refresh, reload

**URL:** <https://discourse.processing.org/t/sketch-using-p5-wrapper-react-not-receiving-props-on-route-change-but-is-receiving-them-on-page-refresh-reload/37797>\
**Category:** Libraries\
**Created:** [July 2, 2022, 4:01pm UTC](https://discourse.processing.org/t/sketch-using-p5-wrapper-react-not-receiving-props-on-route-change-but-is-receiving-them-on-page-refresh-reload/37797 "2022-07-02T16:01:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hifilorau](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hifilorau/32/14767_2.png) [@hifilorau](https://discourse.processing.org/u/hifilorau)\
**Post date:** [July 2, 2022, 4:01pm UTC](https://discourse.processing.org/t/sketch-using-p5-wrapper-react-not-receiving-props-on-route-change-but-is-receiving-them-on-page-refresh-reload/37797/1 "2022-07-02T16:01:11Z")

</div>

Am facing an interesting challenge here. Have a somewhat straightforward architecture where i am passing props into my sketch via:

```auto
  p5.updateWithProps = props => {
      if (props.isLoading) {
        isLoading = props.setIsLoading
      }

      if (props.nftAttributes) {
        nftAttributes = props.setNftAttributes
      }
   };

```

The sketch loads and runs fine when i refresh the page and those functions are passed into the props fine, however when i access the page via a route change it appears that the updateWithProps function is not running prior to my draw function thus making those functions still undefined.

Happy to paste more code if it’s helpful!
