<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FinalBos5</title>
    <description>The latest articles on DEV Community by FinalBos5 (@finalbos5).</description>
    <link>https://dev.to/finalbos5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F671275%2F7ca84062-ef58-4664-a1ca-ffe7886da3fc.png</url>
      <title>DEV Community: FinalBos5</title>
      <link>https://dev.to/finalbos5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/finalbos5"/>
    <language>en</language>
    <item>
      <title>React with p5.js</title>
      <dc:creator>FinalBos5</dc:creator>
      <pubDate>Wed, 21 Jul 2021 06:23:23 +0000</pubDate>
      <link>https://dev.to/finalbos5/react-with-p5-js-2b5j</link>
      <guid>https://dev.to/finalbos5/react-with-p5-js-2b5j</guid>
      <description>&lt;p&gt;I'm trying to use p5 library with react. everything is working fine except I can not use some of the p5s functions like: keyPressed(), keyReleased(). while functions such as mouseClicked() and mousePressed() work just fine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const setup = (p5, canvasParentRef) =&amp;gt; {
        // use parent to render the canvas in this ref
        // (without that p5 will render the canvas outside of your component)
        console.log(props.test)
        const cnv = p5.createCanvas(500, 500).parent(canvasParentRef);
        plr = new Player(p5.width / 2, p5.height / 2);
        food = new Food(p5);

        cnv.mouseClicked((event) =&amp;gt; {
            console.log(event);
        })
        cnv.keyReleased((event) =&amp;gt; {
            console.log(event);
        });
    };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is what the code looks like. mouseClicked gives no errors while keyReleased and other functions which are related to keyboard input give error saying &lt;code&gt;TypeError: cnv.keyReleased is not a function&lt;/code&gt;&lt;/p&gt;

</description>
      <category>p5</category>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
