You are right, this is a scoping issue. Since this frequently changes when you change the scope by calling a new function, you can't access the original value by using it.

You can solve this in 2 ways.

  1. Using fat arrow to bind this with the outer scope in your click handler.

example:

$('#test-popup-yes').click =>
  1. Aliasing this so that you still have access to the original value of this.

example:

confirmRemove: (e) ->
  e.preventDefault()

  that = this //aliasing this to that

  ...

  $('#test-popup-yes').click ->
    $.magnificPopup.close()
    $.ajax
      type:     'PUT'
      dataType: 'JSON'
      url:      "/xxx/#{that.props.xxxId}/remove_entry"
      data:
        '_method': 'PUT'
        'xxx_id': that.props.id
      beforeSend: =>
        $.status_message 'Removing xxx', 0
        that.props.onDeleteStart()
      success: (data) =>
        $.success_message 'Successfully removed xxx'
        that.props.onDeleteCommit()
      error: (data) =>
        $.error_message 'Error removing xxx'
        that.props.onDeleteFailure()
Answer from Deepak on Stack Overflow
🌐
npm
npmjs.com › package › @sekmet › react-magnific-popup
@sekmet/react-magnific-popup - npm
import { MagnificPopup } from 'react-magnific-popup' const SampleComponent = () => { MaginificPopup.props.item; MaginificPopup.props.currItem; MaginificPopup.props.index; MaginificPopup.props.content; MaginificPopup.props.bgOverlay; MaginificPopup.props.wrap; MaginificPopup.props.contentContainer; MaginificPopup.props.st; MaginificPopup.props.isIE7; MaginificPopup.props.isIOS; } NOTE: The source code for the component is in src.
      » npm install @sekmet/react-magnific-popup
    
Published   Oct 26, 2019
Version   1.0.2
Author   Adebiyi Bodunde
🌐
GitHub
github.com › bodunadebiyi › react-magnific-popup
GitHub - bodunadebiyi/react-magnific-popup
import { MagnificPopup } from 'react-magnific-popup' const SampleComponent = () => { MaginificPopup.props.item; MaginificPopup.props.currItem; MaginificPopup.props.index; MaginificPopup.props.content; MaginificPopup.props.bgOverlay; MaginificPopup.props.wrap; MaginificPopup.props.contentContainer; MaginificPopup.props.st; MaginificPopup.props.isIE7; MaginificPopup.props.isIOS; } NOTE: The source code for the component is in src.
Starred by 8 users
Forked by 18 users
Languages   JavaScript 82.8% | CSS 14.2% | HTML 3.0% | JavaScript 82.8% | CSS 14.2% | HTML 3.0%
🌐
CodeSandbox
codesandbox.io › examples › package › react-magnific-popup
react-magnific-popup examples - CodeSandbox
Use this online react-magnific-popup playground to view and fork react-magnific-popup example apps and templates on CodeSandbox.
🌐
Bodunadebiyi
bodunadebiyi.github.io › react-magnific-popup
ReactMagnificPopup
ReactMagnificPopup · View project on GitHub · Copyright © 2017 Adebiyi Bodunde
🌐
npm
npmjs.com › package › react-magnific-popup
react-magnific-popup - npm
October 14, 2017 - You need include jquery.js and the magnific-popup.js plugin in the header of your index.html file of your react application. Live demo and code examples can be found in the link below.
      » npm install react-magnific-popup
    
Published   Oct 14, 2017
Version   1.0.1
Author   Adebiyi Bodunde
🌐
JSFiddle
jsfiddle.net › Shweta4 › n5u2wwjg › 239097
React Magnific Popup - JSFiddle - Code Playground
There was an increadible amount of under-the-hood changes for the front-end, we've mostly moved away from pre-processors. The light/dark themes are using a modern light-dark() approach.
🌐
GitHub
github.com › dimsemenov › Magnific-Popup › issues › 729
React Support · Issue #729 · dimsemenov/Magnific-Popup
September 11, 2015 - Somebody has implemented Magnific-Popup with React? I'm having some problems by now.. I wish to know if this library should works fine with Facebook's React. Regards.
Author   eriknyk
Find elsewhere
🌐
CodeSandbox
codesandbox.io › examples › package › @sekmet › react-magnific-popup
@sekmet/react-magnific-popup examples - CodeSandbox
Use this online @sekmet/react-magnific-popup playground to view and fork @sekmet/react-magnific-popup example apps and templates on CodeSandbox.
🌐
Dimsemenov
dimsemenov.com › plugins › magnific-popup › documentation.html
Magnific Popup Documentation
The complete guide on how to use Magnific Popup - the open source responsive lightbox plugin.
🌐
npm
npmjs.com › package › magnific-popup
magnific-popup - npm
June 8, 2024 - Lightbox and modal dialog plugin. Can display inline HTML, iframes (YouTube video, Vimeo, Google Maps), or an image gallery. Animation effects are added with CSS3 transitions. For jQuery or Zepto.. Latest version: 1.2.0, last published: 2 years ago. Start using magnific-popup in your project ...
      » npm install magnific-popup
    
Published   Jun 08, 2024
Version   1.2.0
Author   Dmytro Semenov
🌐
CodePen
codepen.io › townivan › pres › EVGKEq
magnific-popup example
Here is an example of using magnific-popup to display a video. Importantly, it's also using the built-in feature to disable the popup for phones....
🌐
jsDelivr
jsdelivr.com › package › npm › react-magnific-popup
react-magnific-popup CDN by jsDelivr - A CDN for npm and GitHub
October 14, 2017 - Top version - 0 Full react-magnific-popup Download Stats · Share · Keywords · react · react-component ·
Published   Oct 14, 2017
🌐
GitHub
github.com › bodunadebiyi › react-magnific-popup › blob › master › bower.json
react-magnific-popup/bower.json at master · bodunadebiyi/react-magnific-popup
"homepage": "https://github.com/bodunadebiyi/react-magnific-popup", "authors": [ "Adebiyi Bodunde" ], "moduleType": [ "amd", "globals", "node" ], "keywords": [ "react", "react-component" ], "license": "MIT", "ignore": [ ".editorconfig", ".gitignore", "package.json", "src", "node_modules", "example", "test" ] }
Author   bodunadebiyi
🌐
Dimsemenov
dimsemenov.com › plugins › magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
Light and open source responsive lightbox plugin with focus on performance, for jQuery and Zepto.js. High-DPI (retina) display support, fast tap for touch devices.
🌐
GitHub
github.com › dimsemenov › Magnific-Popup
GitHub - dimsemenov/Magnific-Popup: Light and responsive lightbox script with focus on performance. · GitHub
Use native <dialog> element if you need a basic dialog/modal/popup, or my PhotoSwipe library if you need an advanced image gallery. Feel free to email me if you need assistance. Fast, light and responsive lightbox plugin, for jQuery and Zepto.js. Documentation and getting started guide. Examples and plugin home page. More examples in CodePen collection. Optionally, install via Bower bower install magnific-popup or npm: npm install magnific-popup.
Starred by 11.4K users
Forked by 3.4K users
Languages   JavaScript 67.9% | HTML 18.5% | CSS 8.1% | SCSS 5.5%
🌐
CodePen
codepen.io › jasoncampbell › pen › zNqZmx
On Click :: Magnific Popup Modal
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing. If active, Pens will autosave every 30 seconds after being saved once. If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update. If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting. ... Visit your global Editor Settings. ... <h3>Magnific Popup</h3> <a href="#" class="series-cta-btn">Magnific Popup Link</a> <pre> $(".series-cta-btn").on("click", function () { $.magnificPopup.open({ items:
🌐
npm Trends
npmtrends.com › react-fancybox-vs-react-magnific-popup
react-fancybox vs react-magnific-popup | npm trends
Comparing trends for react-fancybox 0.2.5 which has 356 weekly downloads and 16 GitHub stars vs. react-magnific-popup 1.0.1 which has 44 weekly downloads and 8 GitHub stars.